Skip to content

Instantly share code, notes, and snippets.

@sixtyfive
Created September 15, 2011 15:28
Show Gist options
  • Select an option

  • Save sixtyfive/1219552 to your computer and use it in GitHub Desktop.

Select an option

Save sixtyfive/1219552 to your computer and use it in GitHub Desktop.
Feature: User authentication
Szenario: Existing user logs in
Given the user is on the login page
When the user enters her credentials
And clicks on "Login"
Then the user is redirected to the "Activities" page
@sixtyfive
Copy link
Author

So, would this be better?

Feature: User authentication

Szenario: Existing user logs in
Given a user exists
When that user enters her credentials
Then she is shown her activities for the current week

@sixtyfive
Copy link
Author

Changed it around a bit and added logout:

Feature: User authentication
In order to protect the data from unauthorized access
And still be able to access them,
As a user,
I want to be able to log on to and off of the system.

Scenario: Login
Given an existing user
When I enter my credentials
Then I'm shown the activities for the current week

Scenario: Logout
Given an existing user is logged in
When I log out
Then I'm offered to log in again

@jbpros
Copy link

jbpros commented Sep 15, 2011

Looks really good!

Suggestions:

  • Indent :)
  • There does not seem to be a link between the context (Givens) and the rest of the steps:
  Scenario: Login
    Given I am an existing user
    When I enter my credentials # more explicit action here? "When I login with my credentials" ?
    Then I'm shown the activities for the current week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment