Created
September 27, 2011 18:00
-
-
Save jonpaul/1245765 to your computer and use it in GitHub Desktop.
Cuke a boolean
This file contains hidden or 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 | unconfirmed | | |
| [email protected] | password | true | | |
And "[email protected]" opens the email with subject "Confirmation instructions" | |
And they follow "Confirm my account" in the email | |
Then I should see "Your account was successfully confirmed" | |
And I should see "Signed in as [email protected]" | |
Scenario: Signing in via a form | |
Given there are the following users: | |
| email | password | | |
| [email protected] | password | | |
And I am on the homepage | |
When I follow "Sign in" | |
And I fill in "Email" with "[email protected]" | |
And I fill in "Password" with "password" | |
And I press "Sign in" | |
Then I should see "Signed in successfully." |
This file contains hidden or 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 |attr| | |
unconfirmed = attr.delete("unconfirmed") == "true" | |
@user = User.create!(attr) | |
@user.confirm! unless unconfirmed | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment