Created
May 8, 2011 21:50
-
-
Save roykolak/961717 to your computer and use it in GitHub Desktop.
Creating a custom Capybara driver.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/acceptance/support/helper.rb | |
# ... Other config stuff | |
Capybara.register_driver :mobile do |app| | |
Capybara::RackTest::Driver.new(app, :headers => {'HTTP_USER_AGENT' => 'Mobile'}) | |
end | |
def switch_driver(driver) | |
before(:each) do | |
Capybara.current_driver = driver | |
end | |
after(:each) do | |
Capybara.use_default_driver | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment