Cucumber Features

Expand All

Collapse All

Feature: Organizations

In order to use the service
As a user
I want to create, edit and delete organizations

features/organizations.feature:6

Scenario: Creating an organization

  1. Given I am signed in
    features/step_definitions/session_steps.rb:12
  2. When I click "Organizations"
    features/step_definitions/generic_steps.rb:1
  3. And I click "Create organization"
    features/step_definitions/generic_steps.rb:1
  4. And I fill in the form with the following:
    features/step_definitions/generic_steps.rb:9
    Name
    ACME Inc
  5. Then I should be on the organization page for "ACME Inc"
    features/step_definitions/navigation_steps.rb:38
  6. When I click "Organization Users"
    features/step_definitions/generic_steps.rb:1
  7. And the organization should have the following users:
    features/step_definitions/organization_steps.rb:28
    Name
    Email
    Role
    Test User
    test@example.com
    admin
features/organizations.feature:18

Scenario: Editing an organization

  1. Given I have created an organization
    features/step_definitions/organization_steps.rb:1
  2. When I go to the organization edit page for "ACME Inc"
    features/step_definitions/organization_steps.rb:16
  3. And I fill in the form with the following:
    features/step_definitions/generic_steps.rb:9
    Name
    ACME Incorporated
  4. Then I should be on the organization page for "ACME Incorporated"
    features/step_definitions/navigation_steps.rb:38
features/organizations.feature:25

Scenario: Deleting an organization

  1. Given I have created an organization
    features/step_definitions/organization_steps.rb:1
  2. When I go to the organization edit page for "ACME Inc"
    features/step_definitions/organization_steps.rb:16
  3. And I click "Delete this organization"
    features/step_definitions/generic_steps.rb:1
  4. Then the organization should be deleted
    features/step_definitions/organization_steps.rb:46

Feature: Password Recovery

In order to use the site
As a user
I want to recover my password

features/password_recovery.feature:6

Scenario: Recovering my password

  1. Given I am already registered
    features/step_definitions/session_steps.rb:7
  2. When I go to the home page
    features/step_definitions/navigation_steps.rb:1
  3. And I click "Log In"
    features/step_definitions/generic_steps.rb:1
  4. And I click "Forgotten your password?"
    features/step_definitions/generic_steps.rb:1
  5. And I fill in the form with the following:
    features/step_definitions/generic_steps.rb:9
    Email
    test@example.com
  6. Then I should be on the home page
    features/step_definitions/navigation_steps.rb:5
  7. And "test@example.com" should receive an email with subject "Reset your password"
    features/step_definitions/email_steps.rb:59
  8. When I open the email
    features/step_definitions/email_steps.rb:76
  9. And I click the first link in the email
    features/step_definitions/email_steps.rb:182
  10. Then I should be on the reset password page
    features/step_definitions/navigation_steps.rb:17
  11. When I fill in the form with the following:
    features/step_definitions/generic_steps.rb:9
    Password
    87654321
    Password confirmation
    87654321
  12. Then I should be on the home page
    features/step_definitions/navigation_steps.rb:5
  13. And I should be logged in as "Test User" with email "test@example.com"
    features/step_definitions/session_steps.rb:1
  14. And "test@example.com" should receive an email with subject "Your password has been reset"
    features/step_definitions/email_steps.rb:59
  15. And my password should be "87654321"
    features/step_definitions/session_steps.rb:26

Feature: Payments


So that I can keep my account up to date
As a user
I want to be notified about the success or failure of payments

features/payments.feature:7

Scenario: Successful payment

  1. Given I have created an organization
    features/step_definitions/organization_steps.rb:1
  2. And I am subscribed to the "Pro" plan
    features/step_definitions/subscription_steps.rb:49
  3. Then "test@example.com" should receive an email
    features/step_definitions/email_steps.rb:51
  4. When my payment is processed successfully
    features/step_definitions/subscription_steps.rb:86
  5. Then "test@example.com" should receive 2 emails
    features/step_definitions/email_steps.rb:51
  6. When I open the email with subject "Invoice for Subscription payment"
    features/step_definitions/email_steps.rb:80
  7. Then I should see "Your subscription payment was successful" in the email body
    features/step_definitions/email_steps.rb:108
  8. And I should see "Plan: Pro" in the email body
    features/step_definitions/email_steps.rb:108
  9. And I should see "Amount: $50.00" in the email body
    features/step_definitions/email_steps.rb:108
  10. And I should see "Card: Visa 4242" in the email body
    features/step_definitions/email_steps.rb:108
features/payments.feature:19

Scenario: Failed payment

  1. Given I have created an organization
    features/step_definitions/organization_steps.rb:1
  2. And I am subscribed to the "Pro" plan
    features/step_definitions/subscription_steps.rb:49
  3. Then "test@example.com" should receive an email
    features/step_definitions/email_steps.rb:51
  4. When my payment is declined
    features/step_definitions/subscription_steps.rb:90
  5. Then "test@example.com" should receive 2 emails
    features/step_definitions/email_steps.rb:51
  6. When I open the email with subject "Subscription payment failed"
    features/step_definitions/email_steps.rb:80
  7. Then I should see "The payment for your subscription was unsucessful" in the email body
    features/step_definitions/email_steps.rb:108
  8. And I should see "Please log in at http://example.com/ to update your card details" in the email body
    features/step_definitions/email_steps.rb:108
  9. And I should see "Plan: Pro" in the email body
    features/step_definitions/email_steps.rb:108
  10. And I should see "Amount: $50.00" in the email body
    features/step_definitions/email_steps.rb:108
  11. And I should see "Card: Visa 4242" in the email body
    features/step_definitions/email_steps.rb:108

Feature: Registration

In order to use the site
As a user
I want to register an account

features/registration.feature:6

Scenario: Registering with valid details

  1. When I go to the home page
    features/step_definitions/navigation_steps.rb:1
  2. And I click "Sign Up"
    features/step_definitions/generic_steps.rb:1
  3. And I fill in the form with the following:
    features/step_definitions/generic_steps.rb:9
    Name
    Test User
    Email
    test@example.com
    Password
    12345678
    Password confirmation
    12345678
  4. Then I should be on the home page
    features/step_definitions/navigation_steps.rb:5
  5. Then I should be logged in as "Test User" with email "test@example.com"
    features/step_definitions/session_steps.rb:1
  6. And "test@example.com" should receive an email with subject "Thanks for signing up"
    features/step_definitions/email_steps.rb:59
features/registration.feature:18

Scenario: Registering with invalid details

  1. When I go to the home page
    features/step_definitions/navigation_steps.rb:1
  2. And I click "Sign Up"
    features/step_definitions/generic_steps.rb:1
  3. And I fill in the form with the following:
    features/step_definitions/generic_steps.rb:9
    Name
    Test User
    Email
    not an email
  4. Then I should be on the signup page
    features/step_definitions/navigation_steps.rb:13
  5. And I should not be logged in
    features/step_definitions/session_steps.rb:21
  6. And I should see the following validation errors:
    features/step_definitions/generic_steps.rb:16
    Password can't be blank
    Email is invalid
features/registration.feature:30

Scenario: Updating my registration with valid details

  1. Given I am signed in
    features/step_definitions/session_steps.rb:12
  2. When I go to the home page
    features/step_definitions/navigation_steps.rb:1
  3. And I click on my profile link
    features/step_definitions/navigation_steps.rb:23
  4. And I fill in the form with the following:
    features/step_definitions/generic_steps.rb:9
    Name
    Testy McUser
    Email
    testy@example.com
  5. Then I should be on the home page
    features/step_definitions/navigation_steps.rb:5
  6. And my name should be "Testy McUser"
    features/step_definitions/session_steps.rb:31
  7. And my email address should be "testy@example.com"
    features/step_definitions/session_steps.rb:35
features/registration.feature:41

Scenario: Changing my password

  1. Given I am signed in
    features/step_definitions/session_steps.rb:12
  2. When I go to the home page
    features/step_definitions/navigation_steps.rb:1
  3. And I click on my profile link
    features/step_definitions/navigation_steps.rb:23
  4. And I fill in the form with the following:
    features/step_definitions/generic_steps.rb:9
    Password
    87654321
    Password confirmation
    87654321
  5. Then I should be on the home page
    features/step_definitions/navigation_steps.rb:5
  6. And my password should be "87654321"
    features/step_definitions/session_steps.rb:26
features/registration.feature:51

Scenario: Trying to update my details with invalid values

  1. Given I am signed in
    features/step_definitions/session_steps.rb:12
  2. When I go to the home page
    features/step_definitions/navigation_steps.rb:1
  3. And I click on my profile link
    features/step_definitions/navigation_steps.rb:23
  4. And I fill in the form with the following:
    features/step_definitions/generic_steps.rb:9
    Email
    not an email
    Password
    1234
    Password confirmation
    5678
  5. Then I should be my profile page
    features/step_definitions/navigation_steps.rb:27
  6. And I should see the following validation errors:
    features/step_definitions/generic_steps.rb:16
    Password is too short (minimum is 8 characters)
    Email is invalid
    Password confirmation doesn't match Password

Feature: Sessions

In order to use the site
As a user
I want to sign in

features/sessions.feature:6

Scenario: Logging in with valid details

  1. Given I am already registered
    features/step_definitions/session_steps.rb:7
  2. When I go to the home page
    features/step_definitions/navigation_steps.rb:1
  3. And I click "Log In"
    features/step_definitions/generic_steps.rb:1
  4. And I fill in the form with the following:
    features/step_definitions/generic_steps.rb:9
    Email
    test@example.com
    Password
    12345678
  5. Then I should be on the home page
    features/step_definitions/navigation_steps.rb:5
  6. And I should be logged in as "Test User" with email "test@example.com"
    features/step_definitions/session_steps.rb:1
features/sessions.feature:16

Scenario: Logging in with invalid details

  1. When I go to the home page
    features/step_definitions/navigation_steps.rb:1
  2. And I click "Log In"
    features/step_definitions/generic_steps.rb:1
  3. And I fill in the form with the following:
    features/step_definitions/generic_steps.rb:9
    Email
    invalid@example.com
    Password
    wrong password
  4. Then I should be on the login page
    features/step_definitions/navigation_steps.rb:9
  5. And I should not be logged in
    features/step_definitions/session_steps.rb:21
  6. And I should see the following validation errors:
    features/step_definitions/generic_steps.rb:16
    Email or password is invalid
features/sessions.feature:27

Scenario: Logging out

  1. Given I am signed in
    features/step_definitions/session_steps.rb:12
  2. When I click "Log Out"
    features/step_definitions/generic_steps.rb:1
  3. Then I should be on the home page
    features/step_definitions/navigation_steps.rb:5
  4. And I should not be logged in
    features/step_definitions/session_steps.rb:21

Feature: Subscription

In order to use the service
As a user
I want to create, change and cancel my payment subscription

features/subscription.feature:6

Scenario: Creating a subscription

  1. Given I have created an organization
    features/step_definitions/organization_steps.rb:1
  2. When I go to the subscription page for the organization
    features/step_definitions/organization_steps.rb:54
  3. Then I should see "This organization currently has no subscription"
    features/step_definitions/generic_steps.rb:5
  4. When I click "New Subscription"
    features/step_definitions/generic_steps.rb:1
  5. And I click the Subscribe button for the "Pro" plan
    features/step_definitions/subscription_steps.rb:2
  6. And I fill in the stripe popup with valid card details
    features/step_definitions/subscription_steps.rb:15
  7. Then I should be on the subscription page for the organization
    features/step_definitions/navigation_steps.rb:31
  8. And I should be subscribed to the "Pro" plan
    features/step_definitions/subscription_steps.rb:35
  9. When I click "Modify Subscription"
    features/step_definitions/generic_steps.rb:1
  10. Then I should see "Visa card ending in 4242"
    features/step_definitions/generic_steps.rb:5
  11. And "test@example.com" should receive an email with subject "Your new subscription"
    features/step_definitions/email_steps.rb:59
  12. When I open the email
    features/step_definitions/email_steps.rb:76
  13. Then I should see "Your current subscription plan is Pro" in the email body
    features/step_definitions/email_steps.rb:108
  14. And I should see "Your Visa card ending in 4242 will be billed $50.00 each month" in the email body
    features/step_definitions/email_steps.rb:108
features/subscription.feature:22

Scenario: Changing a subscription

  1. Given I have created an organization
    features/step_definitions/organization_steps.rb:1
  2. And I am subscribed to the "Pro" plan
    features/step_definitions/subscription_steps.rb:49
  3. When I go to the subscription page for the organization
    features/step_definitions/organization_steps.rb:54
  4. And I click "Modify Subscription"
    features/step_definitions/generic_steps.rb:1
  5. And I click the Change Subscription button for the "Enterprise" plan
    features/step_definitions/subscription_steps.rb:9
  6. Then I should be subscribed to the "Enterprise" plan
    features/step_definitions/subscription_steps.rb:35
  7. And "test@example.com" should receive an email with subject "Your subscription plan has been updated"
    features/step_definitions/email_steps.rb:59
  8. When I open the email with subject "Your subscription plan has been updated"
    features/step_definitions/email_steps.rb:80
  9. Then I should see "Your new plan is Enterprise" in the email body
    features/step_definitions/email_steps.rb:108
  10. And I should see "Your Visa card ending in 4242 will be billed $100.00 each month" in the email body
    features/step_definitions/email_steps.rb:108
features/subscription.feature:34

Scenario: Changing to a plan with limit that's too low

  1. Given I have created an organization
    features/step_definitions/organization_steps.rb:1
  2. And I am subscribed to the "Pro" plan
    features/step_definitions/subscription_steps.rb:49
  3. And my current usage is 4
    features/step_definitions/subscription_steps.rb:82
  4. When I go to the subscription page for the organization
    features/step_definitions/organization_steps.rb:54
  5. And I click "Modify Subscription"
    features/step_definitions/generic_steps.rb:1
  6. And I click the Change Subscription button for the "Startup" plan
    features/step_definitions/subscription_steps.rb:9
  7. Then I should see an error notification with the text
    features/step_definitions/generic_steps.rb:23
    You cannot change to this plan because its limit is too low
  8. And I should be subscribed to the "Pro" plan
    features/step_definitions/subscription_steps.rb:35
features/subscription.feature:47

Scenario: Cancelling a plan with usage that's too high

  1. Given I have created an organization
    features/step_definitions/organization_steps.rb:1
  2. And I am subscribed to the "Pro" plan
    features/step_definitions/subscription_steps.rb:49
  3. And my current usage is 4
    features/step_definitions/subscription_steps.rb:82
  4. When I go to the subscription page for the organization
    features/step_definitions/organization_steps.rb:54
  5. And I click "Modify Subscription"
    features/step_definitions/generic_steps.rb:1
  6. And I click "Cancel Subscription"
    features/step_definitions/generic_steps.rb:1
  7. Then I should see an error notification with the text
    features/step_definitions/generic_steps.rb:23
    You cannot cancel your plan until your usage is reduced
  8. And I should be subscribed to the "Pro" plan
    features/step_definitions/subscription_steps.rb:35
features/subscription.feature:60

Scenario: Updating my card

  1. Given I have created an organization
    features/step_definitions/organization_steps.rb:1
  2. And I am subscribed to the "Pro" plan
    features/step_definitions/subscription_steps.rb:49
  3. When I go to the subscription page for the organization
    features/step_definitions/organization_steps.rb:54
  4. And I click "Modify Subscription"
    features/step_definitions/generic_steps.rb:1
  5. And I click "Change Card"
    features/step_definitions/generic_steps.rb:1
  6. And I fill in the stripe popup with a new card
    features/step_definitions/subscription_steps.rb:24
  7. Then the last 4 digits of my card should be updated to '1881'
    features/step_definitions/subscription_steps.rb:58
  8. And "test@example.com" should receive an email with subject "Your card details have been updated"
    features/step_definitions/email_steps.rb:59
  9. When I open the email with subject "Your card details have been updated"
    features/step_definitions/email_steps.rb:80
  10. Then I should see "Visa card ending in 1881" in the email body
    features/step_definitions/email_steps.rb:108
features/subscription.feature:72

Scenario: Cancelling a subscription

  1. Given I have created an organization
    features/step_definitions/organization_steps.rb:1
  2. And I am subscribed to the "Pro" plan
    features/step_definitions/subscription_steps.rb:49
  3. When I go to the subscription page for the organization
    features/step_definitions/organization_steps.rb:54
  4. And I click "Modify Subscription"
    features/step_definitions/generic_steps.rb:1
  5. And I click "Cancel Subscription"
    features/step_definitions/generic_steps.rb:1
  6. Then my subscription should be cancelled
    features/step_definitions/subscription_steps.rb:69
  7. And "test@example.com" should receive an email with subject "Your subscription has been cancelled"
    features/step_definitions/email_steps.rb:59

Feature: Users

In order to collaborate with my colleagues
As a user
I want to invite and manage users in my organization

features/users.feature:6

Scenario: Inviting a user

  1. Given I have created an organization
    features/step_definitions/organization_steps.rb:1
  2. When I go to the users page for the organization
    features/step_definitions/organization_steps.rb:50
  3. And I click "Invite User"
    features/step_definitions/generic_steps.rb:1
  4. And I fill in the form with the following:
    features/step_definitions/generic_steps.rb:9
    Name
    Bob
    Email
    bob@example.com
  5. Then the organization should have the following users:
    features/step_definitions/organization_steps.rb:28
    Name
    Email
    Role
    Test User
    test@example.com
    admin
    Bob
    bob@example.com
    user
  6. And "bob@example.com" should receive an email with subject "You are invited to join ACME Inc"
    features/step_definitions/email_steps.rb:59
  7. When I click "Log Out"
    features/step_definitions/generic_steps.rb:1
  8. When I open the email
    features/step_definitions/email_steps.rb:76
  9. And I click the first link in the email
    features/step_definitions/email_steps.rb:182
  10. And I fill in the form with the following:
    features/step_definitions/generic_steps.rb:9
    Name
    Bob Smith
    Email
    bob@example.com
    Password
    87654321
    Password confirmation
    87654321
  11. Then I should be on the home page
    features/step_definitions/navigation_steps.rb:5
  12. And I should be logged in as "Bob Smith" with email "bob@example.com"
    features/step_definitions/session_steps.rb:1
features/users.feature:30

Scenario: Inviting a user with invalid details

  1. Given I have created an organization
    features/step_definitions/organization_steps.rb:1
  2. When I go to the users page for the organization
    features/step_definitions/organization_steps.rb:50
  3. And I click "Invite User"
    features/step_definitions/generic_steps.rb:1
  4. And I fill in the form with the following:
    features/step_definitions/generic_steps.rb:9
    Name
    Bob
    Email
    not an email
  5. Then I should see the following validation errors:
    features/step_definitions/generic_steps.rb:16
    Email is invalid
features/users.feature:40

Scenario: Changing a user's role

  1. Given I have created an organization
    features/step_definitions/organization_steps.rb:1
  2. And Bob has joined the organization
    features/step_definitions/organization_steps.rb:9
  3. When I go to the users page for the organization
    features/step_definitions/organization_steps.rb:50
  4. And I select "admin" from the role selector
    features/step_definitions/organization_steps.rb:58
  5. Then Bob should be an admin
    features/step_definitions/organization_steps.rb:62
  6. When I select "user" from the role selector
    features/step_definitions/organization_steps.rb:58
  7. Then Bob should be a user
    features/step_definitions/organization_steps.rb:62
features/users.feature:49

Scenario: Removing a user

  1. Given I have created an organization
    features/step_definitions/organization_steps.rb:1
  2. And Bob has joined the organization
    features/step_definitions/organization_steps.rb:9
  3. When I go to the users page for the organization
    features/step_definitions/organization_steps.rb:50
  4. And I click "Remove User"
    features/step_definitions/generic_steps.rb:1
  5. Then the organization should have the following users:
    features/step_definitions/organization_steps.rb:28
    Name
    Email
    Role
    Test User
    test@example.com
    admin
  6. And Bob should no longer be a member of the organization
    features/step_definitions/organization_steps.rb:69