Skip to content

Instantly share code, notes, and snippets.

@cicloid
Forked from cavalle/javascript.rb
Created October 15, 2010 04:26
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 cicloid/627613 to your computer and use it in GitHub Desktop.
Save cicloid/627613 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment