Skip to content

Instantly share code, notes, and snippets.

@MikePearce
Created January 28, 2011 14:31
Show Gist options
  • Save MikePearce/800317 to your computer and use it in GitHub Desktop.
Save MikePearce/800317 to your computer and use it in GitHub Desktop.
Given /^I am logged in as "([^"]*)" with password "([^"]*)"$/ do |user, password|
visit "http://www.website.com:82/login"
#Is there a 'logout'?
if (response_body.match('<span>Login</span>')) then
fill_in "email", :with => user
fill_in "password", :with => password
click_button "Login"
end
response_body.should contain("Your Accounts")
end
After do |scenario|
click_button "Logout"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment