Advertisement
Guest User

Untitled

a guest
Feb 8th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. Feature: Announcement
  2.  
  3. Background:
  4. Given the database is empty
  5. And the following fixtures files are loaded:
  6. | 03.customer.yml |
  7. | 04.academy.yml |
  8. | 13.language.yml |
  9. | 15.announcement_types.yml |
  10.  
  11.  
  12. Scenario:
  13. In order to fill a semester,
  14. as a Super Admin user,
  15. I can create announcement of type "academy". And related activity should be created.
  16.  
  17. When I set my credentials:
  18. |username| notadmin@mail.com |
  19. |password| admin |
  20. When I send a request to create new Announcement with data:
  21. |body | announcement body |
  22. |type | academy |
  23. |show_at| 2012-04-23T18:25:43 |
  24. |academy| 1 |
  25.  
  26. Then the guzzle response status code should be 403
  27.  
  28. When I set my credentials:
  29. |username| admin@test.loc |
  30. |password| admin |
  31. When I send a request to create new Announcement with data:
  32. |body | announcement body |
  33. |type | academy |
  34. |show_at| 2012-04-23T18:25:43 |
  35. |academy| 1 |
  36.  
  37. Then the guzzle response status code should be 201
  38. And there are should be 1 related activity with type "new_announcement"
  39. And there are should be 1 entity "BaseAnnouncement" in DB
  40.  
  41. Scenario:
  42. In order to update a semester content,
  43. as a Super Admin user,
  44. I can update announcement.
  45.  
  46. When I set my credentials:
  47. |username| admin@test.loc |
  48. |password| admin |
  49. When I send a request to update Announcement with id 1:
  50. |body | updated announcement body |
  51. |type | academy |
  52. |show_at| 2012-04-23T18:25:43 |
  53. |academy| 1 |
  54.  
  55. Then the guzzle response status code should be 200
  56. And there are should be 1 entity "BaseAnnouncement" in DB with body "updated announcement body"
  57.  
  58. Scenario:
  59. In order to get data,
  60. as any user,
  61. I can get announcement data.
  62.  
  63. When I set my credentials:
  64. |username| admin@test.loc |
  65. |password| admin |
  66. And I send a request to get Announcement with id 25
  67. Then the guzzle response status code should be 404
  68.  
  69. When I set my credentials:
  70. |username| admin@test.loc |
  71. |password| admin |
  72. And I send a request to get Announcement with id 1
  73.  
  74. Then the guzzle response status code should be 200
  75. And the guzzle response data should contain:
  76. |body | updated announcement body |
  77. |type | academy |
  78. |show_at| 2012-04-23T18:25:43 |
  79. |academy| 1 |
  80.  
  81.  
  82. Scenario:
  83. In order to delete a semester content,
  84. as a Super Admin user,
  85. I can delete announcement.
  86.  
  87. When I set my credentials:
  88. |username| admin@test.loc |
  89. |password| admin |
  90. And I send a request to get Announcement with id 25
  91. Then the guzzle response status code should be 404
  92.  
  93. When I set my credentials:
  94. |username| admin@test.loc |
  95. |password| admin |
  96. And I send a request to get Announcement with id 1
  97.  
  98. Then the guzzle response status code should be 200
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement