update cucumber and refactor some of the stories

inspired by the railscasts about cucumber. Also fix a problem with ZenTest on case sensitive platforms
This commit is contained in:
Reinier Balt 2009-05-22 23:14:40 +02:00
parent bdddac5020
commit 2073f84cd8
11 changed files with 90 additions and 128 deletions

View file

@ -3,23 +3,24 @@ 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
Scenario: Succesfull login
Given an admin user exists
Background:
Given the following user records
| login | password | is_admin |
| testuser | secret | false |
| admin | secret | true |
Scenario Outline: Succesfull and unsuccesfull login
When I go to the login page
And I successfully submit the login form as an admin user
Then I should be redirected to the home page
And I should see "Login successful"
Scenario: Unsuccesfull login
Given an admin user exists
When I go to the login page
And I submit the login form as an admin user with an incorrect password
Then I should be on the login page
And I should see "Login unsuccessful"
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 |
Scenario: Accessing a secured page when not logged in
Given an admin user exists
When I go to the home page
Then I should be redirected to the login page
Then I should be redirected to the login page