2009-11-16 16:02:16 -05:00
|
|
|
require 'capybara'
|
2011-02-24 07:11:00 -05:00
|
|
|
|
2009-11-16 16:02:16 -05:00
|
|
|
require 'capybara/dsl'
|
2011-02-11 08:03:46 -05:00
|
|
|
require 'capybara/rspec/matchers'
|
2009-11-14 04:44:46 -05:00
|
|
|
|
2011-04-11 01:58:42 -04:00
|
|
|
World(Capybara::DSL)
|
2011-02-06 08:44:43 -05:00
|
|
|
World(Capybara::RSpecMatchers)
|
2009-11-16 14:16:12 -05:00
|
|
|
|
2011-09-08 10:43:13 -04:00
|
|
|
Before do
|
2009-11-16 16:02:16 -05:00
|
|
|
Capybara.reset_sessions!
|
2011-09-08 10:43:13 -04:00
|
|
|
Capybara.use_default_driver
|
2009-11-16 14:16:12 -05:00
|
|
|
end
|
|
|
|
|
2011-02-24 07:11:00 -05:00
|
|
|
Before '@javascript' do
|
2009-11-16 16:02:16 -05:00
|
|
|
Capybara.current_driver = Capybara.javascript_driver
|
2009-11-16 14:16:12 -05:00
|
|
|
end
|
|
|
|
|
2011-02-24 07:11:00 -05:00
|
|
|
Before do |scenario|
|
|
|
|
scenario.source_tag_names.each do |tag|
|
|
|
|
driver_name = tag.sub(/^@/, '').to_sym
|
|
|
|
if Capybara.drivers.has_key?(driver_name)
|
|
|
|
Capybara.current_driver = driver_name
|
|
|
|
end
|
|
|
|
end
|
2009-11-18 17:38:27 -05:00
|
|
|
end
|