Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Feature: Add brags to the bragboard
- As an admin
- So that I can publicize brags to tutors and other admins
- I want to add brags to the bragboard
- Background: brags have been added to the bragboard
- Given the following brags exist:
- | title | author | subject | body |
- | title1 | admin1@gmail.com | scholar1@gmail.com | body1 |
- | title2 | admin1@gmail.com | scholar2@gmail.com | body2 |
- Given the following members exist:
- | name | email | position |
- | admin1 | admin1@gmail.com | admin |
- | tutor1 | tutor1@gmail.com | tutor |
- | scholar1 | scholar1@gmail.com | user |
- | scholar2 | scholar2@gmail.com | user |
- Scenario: Admin can see add button
- Given that I am logged in as "admin1@gmail.com"
- Given I visit "/brags"
- Then I should see "Add Brag"
- Given that I am logged in as "scholar1@gmail.com"
- Given I visit "/brags"
- Then I should not see "Add Brag"
- Scenario: Admin can add a brag
- Given that I am logged in as "admin1@gmail.com"
- Given I visit "/brags"
- Given I follow "Add Brag"
- When I fill in "title" with "new_title"
- When I fill in "subject" with "scholar1@gmail.com"
- When I fill in "body" with "new_body"
- When I press "Save Brag"
- Then I should see "new_title"
- Scenario: Brags should validate subject and body
- Given that I am logged in as "admin1@gmail.com"
- Given I visit "/brags/new"
- Given I press "Save Brag"
- Then I should see "Errors"
- Scenario: Admin can edit brags
- Given that I am logged in as "admin1@gmail.com"
- Given I edit brag "title1"
- Given I fill in "title" with "updated title"
- When I press "Save Brag"
- Then I should see "updated title"
- Scenario: I can include a photo
- Given that I am logged in as "admin1@gmail.com"
- Given I edit brag "title1"
- Given I fill in "photos" with "http://test.com/test.jpg"
- And I press "Save Brag"
- Given I edit brag "title1"
- Then I should see "http://test.com/test.jpg"
- Scenario: Admin can delete brags
- Given that I am logged in as "admin1@gmail.com"
- Given I visit "/brags"
- Given I delete brag "title1"
- Given I visit "/brags"
- Then I should not see "title1"
- ***************************************************
- Feature: Admin page for bragboard
- As an admin
- So that I can publicize monitor engagement with brags
- I want to view an admin page
- Background: brags have been added to the bragboard
- Given the following brags exist:
- | title | author | subject | body |
- | title1 | admin1@gmail.com | scholar1@gmail.com | body1 |
- | title2 | admin1@gmail.com | scholar2@gmail.com | body2 |
- Given the following members exist:
- | name | email | position |
- | admin1 | admin1@gmail.com | admin |
- | tutor1 | tutor1@gmail.com | tutor |
- | scholar1 | scholar1@gmail.com | user |
- | scholar2 | scholar2@gmail.com | user |
- Scenario: Admin can see admin button
- Given that I am logged in as "admin1@gmail.com"
- Given I visit "/brags"
- Then I should see "Admin Panel"
- Scenario: Scholars cannot see admin button
- Given that I am logged in as "scholar1@gmail.com"
- Given I visit "/brags"
- Then I should not see "Admin Panel"
- Scenario: Scholars cannot access admin page
- Scenario: Admins can access admin page
- Given that I am logged in as "admin1@gmail.com"
- Given I visit "/brags"
- Given I follow "Admin Panel"
- Then I should see "Brags Admin"
- ************************************************************
- Feature: See brags on the bragboard
- As a user
- So that I can view the achievements of myself and my peers
- I want to view the brags on the bragboard
- Background: brags have been added to the bragboard
- Given the following brags exist:
- | title | author | subject | body |
- | title1 | admin1@gmail.com | scholar1@gmail.com | body1 |
- | title2 | admin1@gmail.com | scholar2@gmail.com | body2 |
- Given the following members exist:
- | name | email | position |
- | admin1 | admin@gmail.com | admin |
- | tutor1 | tutor1@gmail.com | tutor |
- | scholar1 | scholar1@gmail.com | user |
- | scholar2 | scholar2@gmail.com | user |
- Scenario: view brags on the bragboard
- Given that I am logged in as "davidbliu@gmail.com"
- Given I visit "/brags"
- Then I should see "title1"
- And I should see "title2"
- Scenario: view single brag
- Given that I am logged in as "davidbliu@gmail.com"
- Given I visit "/brags"
- Given I follow "title1"
- Then I should see "title1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement