Created
December 8, 2010 13:23
-
-
Save webdevotion/733274 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
Feature: Signing in | |
In order to use the site | |
As a user | |
I want to be able to sign in | |
Scenario: Signing in via confirmation | |
Given there are the following users: | |
| email | password | confirm_user | | |
| user@ticketee.com | password | false | | |
And "user@ticketee.com" opens the email with subject "Confirmation instructions" | |
And they click the first link in the email | |
Then I should see "Your account was successfully confirmed." | |
Scenario: Signing in via form | |
Given there are the following users: | |
| email | password | confirm_user | | |
| user@ticketee.com | password | true | | |
And I am on the homepage | |
When I follow "Sign in" | |
And I fill in "Email" with "user@ticketee.com" | |
And I fill in "Password" with "password" | |
And I press "Sign in" | |
And I dump the response | |
Then I should see "Signed in successfully." |
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
Given /^there are the following users:$/ do |table| | |
table.hashes.each do |attributes| | |
confirm_user = attributes.delete("confirm_user") | |
@user = User.create!(attributes.merge!( :password_confirmation => attributes[:password])) | |
if( confirm_user == "true" ) | |
@user.confirm! | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment