2009-04-17 08:56:11 +02:00
|
|
|
Feature: Existing user logging in
|
|
|
|
|
|
|
|
|
|
In order to keep my things private
|
|
|
|
|
As an existing user
|
|
|
|
|
I want to log in with my username and password
|
2009-05-22 23:14:40 +02:00
|
|
|
|
|
|
|
|
Background:
|
|
|
|
|
Given the following user records
|
|
|
|
|
| login | password | is_admin |
|
|
|
|
|
| testuser | secret | false |
|
|
|
|
|
| admin | secret | true |
|
|
|
|
|
|
|
|
|
|
Scenario Outline: Succesfull and unsuccesfull login
|
2009-04-17 08:56:11 +02:00
|
|
|
When I go to the login page
|
2009-05-22 23:14:40 +02:00
|
|
|
And I submit the login form as user "<user>" with password "<password>"
|
|
|
|
|
Then I should be <there>
|
|
|
|
|
And I should see "<message>"
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
| user | password | there | message |
|
|
|
|
|
| admin | secret | redirected to the home page | Login successful |
|
|
|
|
|
| admin | wrong | on the login page | Login unsuccessful |
|
2009-04-17 08:56:11 +02:00
|
|
|
|
|
|
|
|
Scenario: Accessing a secured page when not logged in
|
|
|
|
|
When I go to the home page
|
2009-05-22 23:14:40 +02:00
|
|
|
Then I should be redirected to the login page
|