Skip to content

Instantly share code, notes, and snippets.

@jonpaul
Created September 27, 2011 18:00
Show Gist options
  • Save jonpaul/1245765 to your computer and use it in GitHub Desktop.
Save jonpaul/1245765 to your computer and use it in GitHub Desktop.
Cuke a boolean
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."
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