Created
September 12, 2009 16:01
-
-
Save ignu/185888 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
Scenario: Log in | |
Given I am registered as 'Tony' with password 'ABC123' | |
When I go to the login page | |
And I fill in "username" with "Tony" | |
And I fill in "password" with "ABC123" | |
And I press "submit" | |
Then I should be on the survey start page | |
# Works! | |
# Refactored to: | |
Scenario: Log in | |
Given I am registered as 'Tony' with password 'ABC123' | |
When I login with 'Tony' and 'ABC123' | |
Then I should be on the survey start page | |
def login_with(username, password) | |
visit '/login' | |
fill_in('username', username) #doesn't seem to work | |
fill_in('password', password) #doesn't seem to work | |
click_button('submit') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment