Sha256: efb4e30b9e64bce8483c601e703722f27ccb880bb4cb3ac2a090fbe6b7445feb

Contents?: true

Size: 1.89 KB

Versions: 1

Compression:

Stored size: 1.89 KB

Contents

inject_into_file 'features/support/paths.rb', :after => "case page_name\n" do
<<-'FILE'

      when /the admin/
        '/admin'

      when /the add user page/
        '/admin/users/new'
FILE
end

create_file 'features/admin.feature' do
<<-'FILE'
Feature: Admin dashboard
  As an administrator
  I want to manage the application
  So that I can have full control over the site

  Scenario: Login as an admin
    Given a logged in admin
    When I am on the admin
    Then I should see "Admin"
FILE
end

create_file 'features/user_admin.feature' do
<<-'FILE'
Feature: Administer users
  As an administrator
  I want to manage the users
  So that I can provide support for them

  Background:
    Given a logged in admin

  Scenario: Create, update, delete a user in the admin
    When I am on the add user page
    And I fill in the following:
    | Email                 | big@sirluciousleftfoot.com |
    | Username              | bigboi                     |
    | Password              | Ch!coDusty$                |
    | Password confirmation | Ch!coDusty$                |
    And I press "Save"
    Then I should see "User created!"
    And I should see "bigboi"

    When I follow "bigboi"
    Then the "Username" field should contain "bigboi"
    And the "Email" field should contain "big@sirluciousleftfoot.com"
    And the "Admin" checkbox should not be checked

    Then I fill in "Username" with "biggerboi"
    And I fill in "Email" with "bigger@sirluciousleftfoot.com"
    And I check "Admin"
    And I press "Save"
    Then I should see "Successfully updated biggerboi."

    When I follow "biggerboi"
    Then the "Username" field should contain "biggerboi"
    And the "Email" field should contain "bigger@sirluciousleftfoot.com"
    And the "Admin" checkbox should be checked
    Then I press "Save"

    Then I follow "Delete"
    Then I should see "User deleted."
    And I should not see "biggerboi"


FILE
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mologue-0.0.1 templates/admin/cucumber.rb