Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Feature: Announcement
- Background:
- Given the database is empty
- And the following fixtures files are loaded:
- | 03.customer.yml |
- | 04.academy.yml |
- | 13.language.yml |
- | 15.announcement_types.yml |
- Scenario:
- In order to fill a semester,
- as a Super Admin user,
- I can create announcement of type "academy". And related activity should be created.
- When I set my credentials:
- |username| notadmin@mail.com |
- |password| admin |
- When I send a request to create new Announcement with data:
- |body | announcement body |
- |type | academy |
- |show_at| 2012-04-23T18:25:43 |
- |academy| 1 |
- Then the guzzle response status code should be 403
- When I set my credentials:
- |username| admin@test.loc |
- |password| admin |
- When I send a request to create new Announcement with data:
- |body | announcement body |
- |type | academy |
- |show_at| 2012-04-23T18:25:43 |
- |academy| 1 |
- Then the guzzle response status code should be 201
- And there are should be 1 related activity with type "new_announcement"
- And there are should be 1 entity "BaseAnnouncement" in DB
- Scenario:
- In order to update a semester content,
- as a Super Admin user,
- I can update announcement.
- When I set my credentials:
- |username| admin@test.loc |
- |password| admin |
- When I send a request to update Announcement with id 1:
- |body | updated announcement body |
- |type | academy |
- |show_at| 2012-04-23T18:25:43 |
- |academy| 1 |
- Then the guzzle response status code should be 200
- And there are should be 1 entity "BaseAnnouncement" in DB with body "updated announcement body"
- Scenario:
- In order to get data,
- as any user,
- I can get announcement data.
- When I set my credentials:
- |username| admin@test.loc |
- |password| admin |
- And I send a request to get Announcement with id 25
- Then the guzzle response status code should be 404
- When I set my credentials:
- |username| admin@test.loc |
- |password| admin |
- And I send a request to get Announcement with id 1
- Then the guzzle response status code should be 200
- And the guzzle response data should contain:
- |body | updated announcement body |
- |type | academy |
- |show_at| 2012-04-23T18:25:43 |
- |academy| 1 |
- Scenario:
- In order to delete a semester content,
- as a Super Admin user,
- I can delete announcement.
- When I set my credentials:
- |username| admin@test.loc |
- |password| admin |
- And I send a request to get Announcement with id 25
- Then the guzzle response status code should be 404
- When I set my credentials:
- |username| admin@test.loc |
- |password| admin |
- And I send a request to get Announcement with id 1
- Then the guzzle response status code should be 200
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement