Skip to content

Instantly share code, notes, and snippets.

@mattheworiordan
Forked from zenom/spec.rb
Created April 8, 2011 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattheworiordan/910216 to your computer and use it in GitHub Desktop.
Save mattheworiordan/910216 to your computer and use it in GitHub Desktop.
scenario "have ability to edit profile", :js => true do
@ability.should be_able_to(:edit, @profile)
end
RSpec.configure do |config|
config.include Capybara
config.before(:each) do
Capybara.current_driver = :akephalos if example.metadata[:js]
Capybara.current_driver = example.metadata[:driver] if example.metadata[:driver]
end
config.after(:each) do
Capybara.use_default_driver if example.metadata[:js]
Capybara.use_default_driver if example.metadata[:driver]
end
end
@mattheworiordan
Copy link
Author

Has better support than the original Gist for both specifying the use of JS using default Akephalos driver, or allowing the driver to be specified explicitly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment