Skip to content

Instantly share code, notes, and snippets.

@mcrmfc
Created March 22, 2011 09:22
Show Gist options
  • Save mcrmfc/880973 to your computer and use it in GitHub Desktop.
Save mcrmfc/880973 to your computer and use it in GitHub Desktop.
Set custom headers using Capybara-Mechanize
When /^I go to google$/ do
p page.driver.agent.request_headers = {'Accept-Language' => 'en-gb'}
visit('http://localhost:7001')
end
Then /^I should see the title google$/ do
find('title').text.should == 'RubyGems Documentation Index'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment