Skip to content

Instantly share code, notes, and snippets.

@williamn
Created August 11, 2011 14:45
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 williamn/1139841 to your computer and use it in GitHub Desktop.
Save williamn/1139841 to your computer and use it in GitHub Desktop.
Feature examples
Feature
In order to use the manage my church
As a user
I want to sign in and sign out
Scenario: Sign in
Given I am a non-authenticated user
When I go to "/login"
And I fill in "Email" with "admin@example.com"
And I fill in "Password" with "pass"
And I press "Log in"
Then I should be on "/"
Scenario: Sign out
Given I am an authenticated user
When I go to "/logout"
Then I should be on "/login"
Scenario: Only authenticated user access admin pages
Given I am a non-authenticated user
When I go to "/dashboard"
Then I should be on "/login"
Feature
In order to manage devices
As an authenticated user
I want to list, create, update and destroy devices
Scenario: List devices
Given I am an authenticated user
When I go to "/admin/devices"
Then I should see existing devices
Scenario: Adding a device
Given I am an authenticated user
When I go to "/admin/devices/new"
And I fill in "Identifier" with "IDFOO"
And I press "Save"
Then I should be on "/admin/devices"
And I should see "IDFOO"
Scenario: Editing a device
Given I am an authenticated user
When I go to "/admin/devices"
And I click the edit link for "IDFOO"
Then I should see "IDFOO" within "Identifier"
When I fill in "Identifier" with "IDBAR"
And I press "Save"
Then I should see "IDBAR" in "/admin/devices"
And I should not see "IDFOO" in "/admin/devices"
Scenario: Removing a device
Given I am an authenticated user
When I go to "/admin/devices"
And I click the delete link for "IDBAR"
Then I should not see "IDBAR" in "/admin/devices"
Scenario: Device identifier must be unique
Given I am an authenticated user
And a device identified as "IDBAR"
When I go to "/admin/devices/new"
And I fill in "Identifier" with "IDBAR"
And I press "Save"
Then I should see "IDBAR has already been registered"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment