Skip to content

Instantly share code, notes, and snippets.

@cavalle
Created May 11, 2010 22:38
Show Gist options
  • Save cavalle/397977 to your computer and use it in GitHub Desktop.
Save cavalle/397977 to your computer and use it in GitHub Desktop.
# This works with steak 0.3.x and rspec 1.x
# For steak --pre and rspec 2 see this fork: http://gist.github.com/448487
# Put this code in acceptance_helper.rb or better in a new file spec/acceptance/support/javascript.rb
Spec::Runner.configure do |config|
config.before(:each) do
Capybara.current_driver = :selenium if options[:js]
end
config.after(:each) do
Capybara.use_default_driver if options[:js]
end
end
#...
scenario "Scenario that needs Javascript", :js => true do
#...
end
scenario "Scenario that doesn't need Javascript" do
#...
end
@kristianmandrup
Copy link

Thanks :)

@guilleiguaran
Copy link

Looks like that isn't required anymore: http://jeffkreeftmeijer.com/2011/capybara-ate-swinger/

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