Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sxross/124924 to your computer and use it in GitHub Desktop.
Save sxross/124924 to your computer and use it in GitHub Desktop.
Some basic features and scenarios for authentication. Implementation left out. Sorry.
Feature: Signing up for an account
In order to use the site
As a visitor
I sign up for an account
Scenario:
Given I'm an anonymous visitor
And I go to the home page
Then I should see "Login"
And the page title should be "Log In"
Then I follow "Register"
And the page title should be "Register"
When I fill in the new user register form
Then flash should display "Account registered!" notice
Feature: Logging in and out of an account
In order to use the site
As a registered visitor
I log in and log out
Scenario:
Given I'm a registered user
And I go to the home page
Then the page title should be "Log In"
When I fill in the login form
Then flash should display "Successfully Logged In" notice
And I should see "logout"
Scenario:
Given I am logged in
And I follow "logout"
Then flash should display "Successfully Logged Out" notice
And I should see "login"
Feature: Signing up for an account
In order to retrieve a forgotten password
As a visitor who has already signed up
I reset my password
Scenario:
Given I have an account with an email of "[email protected]"
When I go to the reset password page
Then I fill in and submit the reset form
Then "[email protected]" should receive 1 email
When "[email protected]" opens the email with subject "Password Reset Instructions"
And I click the first link in the email
Then I should see "Change My Password"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment