Created
March 30, 2011 13:22
-
-
Save kristianhellquist/894366 to your computer and use it in GitHub Desktop.
Cucumber: Sessions
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: User session creation | |
As a member | |
I want to log in | |
So that I get access to member functionality | |
Scenario: Not registred | |
Given I am on the login page | |
When I fill in the following: | |
| Email | foo@bar.com | | |
| Password | secret | | |
And I press "Log in" | |
Then I should see "is not valid" | |
Scenario: Blank form | |
Given I am on the login page | |
When I press "Log in" | |
Then I should see "You did not provide any details for authentication" | |
Scenario: Incorrect password | |
Given a user with email "foo@bar.com" exists | |
And I am on the login page | |
When I fill in the following: | |
| Email | foo@bar.com | | |
| Password | wrong_password | | |
And I press "Log in" | |
Then I should see "is not valid" | |
Scenario: Successful log in | |
Given I have an account with email "foo@bar.com" and password "secret" | |
And I am on the login page | |
When I fill in the following: | |
| Email | foo@bar.com | | |
| Password | secret | | |
And I press "Log in" | |
Then I should be logged in | |
And I should see the profile form | |
And I should not see "Sign up" | |
Scenario: Already logged in | |
Given I am registered and log in with email "foo@bar.com" | |
When I go to the login page | |
Then I should see "You need to log out first" | |
@javascript | |
Scenario: Following "Log in" | |
Given I am on the home page | |
When I follow "Log in" | |
Then I should see the login form | |
Scenario: Redirected when logging in | |
Given I have an account with email "foo@bar.com" and password "secret" | |
When I go to the profile page | |
Then I should see "You need to log in first" | |
And I should see "Email" | |
And I should see "Password" | |
When I fill in the following: | |
| Email | foo@bar.com | | |
| Password | secret | | |
And I press "Log in" | |
Then I should see the profile form |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment