New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

capybara-restore_state

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capybara-restore_state

  • 1.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= capybara-restore_state

capybara-restore_state offers the ability to execute a block where the initial capybara state on entering the block is returned after the block is executed. This makes it possible to test things like clicking on the same button twice.

This only works for the rack-test driver, other drivers can use the back buttons provided by the browser.

= Installation

gem install capybara-restore_state

= Source Code

Source code is available on GitHub at https://github.com/jeremyevans/capybara-restore_state

= Examples

require 'capybara' require 'capybara/restore_state'

describe Capybara::RestoreState do include Rack::Test::Methods include Capybara::DSL include Capybara::RestoreState

def app
  MyRackApp
end

it "should allow restoring of state" do
  # Assume Submit button takes you /a
  visit '/'
  page.current_path # => '/'

  restore_state do
    page.current_path # => '/'
    click_button 'Submit'
    page.current_path # => '/a'
  end

  page.current_path # => '/'
  click_button 'Submit'
  page.current_path # => '/a'
end

end

= License

MIT

= Author

Jeremy Evans code@jeremyevans.net

FAQs

Package last updated on 21 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc