public
Created

Feature examples

  • Download Gist
authentication.feature
Cucumber
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
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"
manage_devices.feature
Cucumber
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
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"

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.