Skip to content

Instantly share code, notes, and snippets.

@donnoman
Created July 28, 2011 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donnoman/1112161 to your computer and use it in GitHub Desktop.
Save donnoman/1112161 to your computer and use it in GitHub Desktop.
Sample Cucumber Spec
Story: Visitor should be able to log in
As a visitor
I should be able to login
So that I can have access to the application
Scenario: Visitor visits the home page
Given a logged out visitor
When visitor goes to the home page
Then visitor should see the sessions/new page
Scenario: Login without a password
Given a logged out visitor
And valid login credentials without password
When visitor attempts to login
Then visitor should see the sessions/new page
And page should include text: Sorry, invalid username/password
And should not be logged in
Scenario: Login without a username
Given a logged out visitor
And valid login credentials without username
When visitor attempts to login
Then visitor should see the sessions/new page
And page should include text: Sorry, invalid username/password
And should not be logged in
Scenario: Login with invalid credentials
Given a logged out visitor
And invalid login credentials
When visitor attempts to login
Then visitor should see the sessions/new page
And page should include text: Sorry, invalid username/password
And should not be logged in
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment