Skip to content

Instantly share code, notes, and snippets.

@danmcclain
Created September 20, 2011 14:57
Show Gist options
  • Save danmcclain/1229321 to your computer and use it in GitHub Desktop.
Save danmcclain/1229321 to your computer and use it in GitHub Desktop.
scenario 'Logging in' do
ENV["BOSTONRB_ADMIN_NAME"] = name
ENV["BOSTONRB_ADMIN_PASSWORD"] = password
if page.driver.respond_to?(:basic_auth)
page.driver.basic_auth(name, password)
elsif page.driver.respond_to?(:basic_authorize)
page.driver.basic_authorize(name, password)
elsif page.driver.respond_to?(:browser) && page.driver.browser.respond_to?(:basic_authorize)
page.driver.browser.basic_authorize(name, password)
else
raise "I don't know how to log in!"
end
visit admin_presentations_path
page.driver.response.status.should == 200
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment