Created
April 7, 2010 08:38
-
-
Save aslakhellesoy/358664 to your computer and use it in GitHub Desktop.
This file contains 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
module RackHeaderHack | |
def set_headers(headers) | |
driver = page.driver | |
def driver.env | |
@env.merge(super) | |
end | |
def driver.env=(env) | |
@env = env | |
end | |
driver.env = headers | |
end | |
end | |
World(RackHeaderHack) | |
Given /^I have some funky headers set by the proxy between the browser and my webapp$/ do | |
set_headers({"X-company" => "Bigcorp"}) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To make this work with current version of capybara (1.0.0 as of this writing) change
page.driver
topage.driver.browser