Advertisement
Guest User

Untitled

a guest
Apr 1st, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.28 KB | None | 0 0
  1. Feature: Add brags to the bragboard
  2. As an admin
  3. So that I can publicize brags to tutors and other admins
  4. I want to add brags to the bragboard
  5.  
  6. Background: brags have been added to the bragboard
  7.  
  8. Given the following brags exist:
  9. | title | author | subject | body |
  10. | title1 | admin1@gmail.com | scholar1@gmail.com | body1 |
  11. | title2 | admin1@gmail.com | scholar2@gmail.com | body2 |
  12.  
  13. Given the following members exist:
  14. | name | email | position |
  15. | admin1 | admin1@gmail.com | admin |
  16. | tutor1 | tutor1@gmail.com | tutor |
  17. | scholar1 | scholar1@gmail.com | user |
  18. | scholar2 | scholar2@gmail.com | user |
  19.  
  20. Scenario: Admin can see add button
  21. Given that I am logged in as "admin1@gmail.com"
  22. Given I visit "/brags"
  23. Then I should see "Add Brag"
  24. Given that I am logged in as "scholar1@gmail.com"
  25. Given I visit "/brags"
  26. Then I should not see "Add Brag"
  27.  
  28. Scenario: Admin can add a brag
  29. Given that I am logged in as "admin1@gmail.com"
  30. Given I visit "/brags"
  31. Given I follow "Add Brag"
  32. When I fill in "title" with "new_title"
  33. When I fill in "subject" with "scholar1@gmail.com"
  34. When I fill in "body" with "new_body"
  35. When I press "Save Brag"
  36. Then I should see "new_title"
  37.  
  38. Scenario: Brags should validate subject and body
  39. Given that I am logged in as "admin1@gmail.com"
  40. Given I visit "/brags/new"
  41. Given I press "Save Brag"
  42. Then I should see "Errors"
  43.  
  44. Scenario: Admin can edit brags
  45. Given that I am logged in as "admin1@gmail.com"
  46. Given I edit brag "title1"
  47. Given I fill in "title" with "updated title"
  48. When I press "Save Brag"
  49. Then I should see "updated title"
  50.  
  51. Scenario: I can include a photo
  52. Given that I am logged in as "admin1@gmail.com"
  53. Given I edit brag "title1"
  54. Given I fill in "photos" with "http://test.com/test.jpg"
  55. And I press "Save Brag"
  56. Given I edit brag "title1"
  57. Then I should see "http://test.com/test.jpg"
  58.  
  59. Scenario: Admin can delete brags
  60. Given that I am logged in as "admin1@gmail.com"
  61. Given I visit "/brags"
  62. Given I delete brag "title1"
  63. Given I visit "/brags"
  64. Then I should not see "title1"
  65.  
  66. ***************************************************
  67.  
  68. Feature: Admin page for bragboard
  69. As an admin
  70. So that I can publicize monitor engagement with brags
  71. I want to view an admin page
  72.  
  73. Background: brags have been added to the bragboard
  74.  
  75. Given the following brags exist:
  76. | title | author | subject | body |
  77. | title1 | admin1@gmail.com | scholar1@gmail.com | body1 |
  78. | title2 | admin1@gmail.com | scholar2@gmail.com | body2 |
  79.  
  80. Given the following members exist:
  81. | name | email | position |
  82. | admin1 | admin1@gmail.com | admin |
  83. | tutor1 | tutor1@gmail.com | tutor |
  84. | scholar1 | scholar1@gmail.com | user |
  85. | scholar2 | scholar2@gmail.com | user |
  86.  
  87. Scenario: Admin can see admin button
  88. Given that I am logged in as "admin1@gmail.com"
  89. Given I visit "/brags"
  90. Then I should see "Admin Panel"
  91.  
  92. Scenario: Scholars cannot see admin button
  93. Given that I am logged in as "scholar1@gmail.com"
  94. Given I visit "/brags"
  95. Then I should not see "Admin Panel"
  96.  
  97. Scenario: Scholars cannot access admin page
  98.  
  99. Scenario: Admins can access admin page
  100. Given that I am logged in as "admin1@gmail.com"
  101. Given I visit "/brags"
  102. Given I follow "Admin Panel"
  103. Then I should see "Brags Admin"
  104.  
  105. ************************************************************
  106.  
  107. Feature: See brags on the bragboard
  108. As a user
  109. So that I can view the achievements of myself and my peers
  110. I want to view the brags on the bragboard
  111.  
  112. Background: brags have been added to the bragboard
  113.  
  114. Given the following brags exist:
  115. | title | author | subject | body |
  116. | title1 | admin1@gmail.com | scholar1@gmail.com | body1 |
  117. | title2 | admin1@gmail.com | scholar2@gmail.com | body2 |
  118.  
  119. Given the following members exist:
  120. | name | email | position |
  121. | admin1 | admin@gmail.com | admin |
  122. | tutor1 | tutor1@gmail.com | tutor |
  123. | scholar1 | scholar1@gmail.com | user |
  124. | scholar2 | scholar2@gmail.com | user |
  125.  
  126. Scenario: view brags on the bragboard
  127. Given that I am logged in as "davidbliu@gmail.com"
  128. Given I visit "/brags"
  129. Then I should see "title1"
  130. And I should see "title2"
  131.  
  132. Scenario: view single brag
  133. Given that I am logged in as "davidbliu@gmail.com"
  134. Given I visit "/brags"
  135. Given I follow "title1"
  136. Then I should see "title1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement