Guest User

Untitled

a guest
Jan 15th, 2018
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.85 KB | None | 0 0
  1. Feature: Create project
  2. As a admin of Donately
  3. I want to create project
  4.  
  5. Background:
  6. # Creating admin
  7. Given a admin exists with an email address of "admin@donately.com"
  8.  
  9. # Creating campaigns
  10. And a campaign exists with title "Individual Fundraisers" and goal $"10000"
  11. And a campaign exists with title "Water Activists" and goal $"15000"
  12.  
  13. # Creating donors
  14. And a user exists with full name "John Garret" and email "john.garret@mail.com"
  15. And a user exists with full name "Ashley Simpson" and email "ashley.simpson@mail.com"
  16. And a user exists with full name "Steewe Ostin" and email "steewe.ostin@mail.com"
  17. And a user exists with full name "Jessica Parker" and email "jessica.parker@mail.com"
  18. And a user exists with full name "Tony Machete" and email "tony.machete@mail.com"
  19. And a user exists with full name "Dan Balan" and email "dan.balan@mail.com"
  20. And a user exists with full name "Chris Deburg" and email "chris.deburg@mail.com"
  21. And a user exists with full name "Holly Dolly" and email "holly.dolly@mail.com"
  22.  
  23. # Creating fundraisers (closed and opened)
  24. And a fundraiser exists with title "John Garret's water", permalink "garrets_water" and goal "2000", which belongs to campaign "Individual Fundraisers" and created by "John Garret"
  25. And a fundraiser exists with title "Ashlie's water", permalink "ahlies_water" and goal "4500", which belongs to campaign "Individual Fundraisers" and created by "Ashley Simpson"
  26.  
  27. # Creating general campaign donations
  28. And "John Garret" created one time general campaign donation for campaign "Individual Fundraisers" with amount $"500"
  29. And "Dan Balan" created one time general campaign donation for campaign "Individual Fundraisers" with amount $"300"
  30. And "Steewe Ostin" created one time general campaign donation for campaign "Individual Fundraisers" with amount $"1300"
  31.  
  32. # Creating fundraiser donations
  33. And "Jessica Parker" created one time fundraiser donation for fundraiser "John Garret's water" with amount $"1000"
  34. And "Tony Machete" created one time fundraiser donation for fundraiser "John Garret's water" with amount $"1500"
  35. And "Ashley Simpson" created one time fundraiser donation for fundraiser "Ashlie's water" with amount $"1500"
  36.  
  37. # Creating general account donations
  38. And "Chris Deburg" created one time general account donation with amount $"500"
  39. And "Holly Dolly" created one time general account donation with amount $"700"
  40.  
  41. # Login as admin and go to projects page
  42. And I am logged in as admin with email "admin@donately.com"
  43. And I am on the projects page
  44.  
  45. Scenario: I view projects page
  46. And I should see "Listing projects"
  47.  
  48. Scenario: I'm creating project with valid data and using general account donations
  49. When I follow "New Project"
  50. Then I should see "Create a Project - Setup Your Project"
  51. And I select "Individual Fundraisers" from "project_campaign_id"
  52. And I click on general donations button for using general account donations too
  53. And I should see "Available funding"
  54. And I fill in "project_title" with "First project"
  55. And I fill in "project_project_goal" with "5250"
  56. And I fill in "project_permalink" with "first_project"
  57. And I attach the file "images.jpeg" to "project_photo"
  58. And I fill in "project_description" with "First project description"
  59. And I fill in "project_content" with "First project content"
  60. When I press "Next Step: Allocate Funds"
  61. Then I should see "ALLOCATION SNAPSHOT COMPLETED 100% Currently you have allocated $5250.0 of $5250.0 Using 7 donors and 1 fundraisers"
  62. When I press "Next Step: Review and Submit"
  63. Then I should see "Create a Project - Review And Submit"
  64. And I should see "Project Funding: You have allocated $5250 for this project using 7 donors and 1 fundraisers"
  65. And I should see "Title: First project"
  66. And I should see "Project URL: first_project"
  67. And I should see "Campaign that this project belongs to: Individual Fundraisers"
  68. And I should see "Goal $5250"
  69. And I should see "Funded $5250"
  70. When I press "Submit Project"
  71. Then I should see "Congratulations! Your project has been created!"
  72. And I should see "Campaign: Individual Fundraisers"
  73. And I should see "Title: First project"
  74. And I should see "Funded: $5250"
  75. And project named "First project" is created for campaign "Individual Fundraisers" with permalink "first_project" and goal "5250"
  76. And project allocation for project "First project" and donation, created by "John Garret" with amount $"500", successfully created and donation's allocation amount updated with amount $"500"
  77. And project allocation for project "First project" and donation, created by "Dan Balan" with amount $"300", successfully created and donation's allocation amount updated with amount $"300"
  78. And project allocation for project "First project" and donation, created by "Steewe Ostin" with amount $"1300", successfully created and donation's allocation amount updated with amount $"1300"
  79. And project allocation for project "First project" and donation, created by "Jessica Parker" with amount $"1000", successfully created and donation's allocation amount updated with amount $"1000"
  80. And project allocation for project "First project" and donation, created by "Tony Machete" with amount $"1500", successfully created and donation's allocation amount updated with amount $"1500"
  81. And project allocation for project "First project" and donation, created by "Chris Deburg" with amount $"500", successfully created and donation's allocation amount updated with amount $"500"
  82. And project allocation for project "First project" and donation, created by "Holly Dolly" with amount $"700", successfully created and donation's allocation amount updated with amount $"150"
  83.  
  84. Scenario: I'm creating project with valid data and excepting general account donations
  85. When I follow "New Project"
  86. Then I should see "Create a Project - Setup Your Project"
  87. And I select "Individual Fundraisers" from "project_campaign_id"
  88. And I should see "Available funding"
  89. And I fill in "project_title" with "First project"
  90. And I fill in "project_project_goal" with "5250"
  91. And I fill in "project_permalink" with "first_project"
  92. When I press "Next Step: Allocate Funds"
  93. Then I should see "Unfortunately, goal of your new project exceeds donations amount! Please, define project goal less!"
  94. And I select "Individual Fundraisers" from "project_campaign_id"
  95. And I should see "Available funding"
  96. And I fill in "project_title" with "First project"
  97. And I fill in "project_project_goal" with "4500"
  98. And I fill in "project_permalink" with "first_project"
  99. When I press "Next Step: Allocate Funds"
  100. Then I should see "ALLOCATION SNAPSHOT COMPLETED 100% Currently you have allocated $4500.0 of $4500.0 Using 5 donors and 1 fundraisers"
  101. When I press "Next Step: Review and Submit"
  102. Then I should see "Create a Project - Review And Submit"
  103. And I should see "Project Funding: You have allocated $4500 for this project using 5 donors and 1 fundraisers"
  104. And I should see "Title: First project"
  105. And I should see "Project URL: first_project"
  106. And I should see "Campaign that this project belongs to: Individual Fundraisers"
  107. And I should see "Goal $4500"
  108. And I should see "Funded $4500"
  109. When I press "Submit Project"
  110. Then I should see "Congratulations! Your project has been created!"
  111. And I should see "Campaign: Individual Fundraisers"
  112. And I should see "Title: First project"
  113. And I should see "Funded: $4500"
  114. And project named "First project" is created for campaign "Individual Fundraisers" with permalink "first_project" and goal "4500"
  115. And project allocation for project "First project" and donation, created by "John Garret" with amount $"500", successfully created and donation's allocation amount updated with amount $"500"
  116. And project allocation for project "First project" and donation, created by "Dan Balan" with amount $"300", successfully created and donation's allocation amount updated with amount $"300"
  117. And project allocation for project "First project" and donation, created by "Steewe Ostin" with amount $"1300", successfully created and donation's allocation amount updated with amount $"1300"
  118. And project allocation for project "First project" and donation, created by "Jessica Parker" with amount $"1000", successfully created and donation's allocation amount updated with amount $"1000"
  119. And project allocation for project "First project" and donation, created by "Tony Machete" with amount $"1500", successfully created and donation's allocation amount updated with amount $"1400"
  120.  
  121. Scenario: I am creating project with manual selecting and spliting donations
  122. When I follow "New Project"
  123. Then I should see "Create a Project - Setup Your Project"
  124. And I select "Individual Fundraisers" from "project_campaign_id"
  125. And I click on general donations button for using general account donations too
  126. And I should see "Available funding"
  127. And I fill in "project_title" with "First project"
  128. And I fill in "project_project_goal" with "2175"
  129. And I fill in "project_permalink" with "first_project"
  130. And I attach the file "images.jpeg" to "project_photo"
  131. And I fill in "project_description" with "First project description"
  132. And I fill in "project_content" with "First project content"
  133. When I press "Next Step: Allocate Funds"
  134. Then I should see "ALLOCATION SNAPSHOT COMPLETED 100% Currently you have allocated $2175.0 of $2175.0 Using 4 donors and 1 fundraisers"
  135. And I uncheck donation, created by "John Garret" with amount $"500"
  136. And I uncheck donation, created by "Dan Balan" with amount $"300"
  137. And I uncheck donation, created by "Steewe Ostin" with amount $"1300"
  138. And I uncheck donation, created by "Jessica Parker" with amount $"1000"
  139. And I check donation, created by "Tony Machete" with amount $"1500"
  140. And I check donation, created by "Chris Deburg" with amount $"500"
  141. And I check donation, created by "Holly Dolly" with amount $"700"
  142. And I split donation, created by "Holly Dolly" with amount $"700", with value $"175"
  143. When I press "Next Step: Review and Submit"
  144. Then I should see "Create a Project - Review And Submit"
  145. And I should see "Project Funding: You have allocated $2175 for this project using 3 donors and 1 fundraisers"
  146. And I should see "Title: First project"
  147. And I should see "Project URL: first_project"
  148. And I should see "Campaign that this project belongs to: Individual Fundraisers"
  149. And I should see "Goal $2175"
  150. And I should see "Funded $2175"
  151. When I press "Submit Project"
  152. Then I should see "Congratulations! Your project has been created!"
  153. And I should see "Campaign: Individual Fundraisers"
  154. And I should see "Title: First project"
  155. And I should see "Funded: $2175"
  156. And project named "First project" is created for campaign "Individual Fundraisers" with permalink "first_project" and goal "2175"
  157. And project allocation for project "First project" and donation, created by "John Garret" with amount $"500", not created and donation's allocation amount not updated with amount $"500"
  158. And project allocation for project "First project" and donation, created by "Dan Balan" with amount $"300", not created and donation's allocation amount not updated with amount $"300"
  159. And project allocation for project "First project" and donation, created by "Steewe Ostin" with amount $"1300", not created and donation's allocation amount not updated with amount $"1300"
  160. And project allocation for project "First project" and donation, created by "Jessica Parker" with amount $"1000", not created and donation's allocation amount not updated with amount $"75"
  161. And project allocation for project "First project" and donation, created by "Tony Machete" with amount $"1500", successfully created and donation's allocation amount updated with amount $"1500"
  162. And project allocation for project "First project" and donation, created by "Chris Deburg" with amount $"500", successfully created and donation's allocation amount updated with amount $"500"
  163. And project allocation for project "First project" and donation, created by "Holly Dolly" with amount $"700", successfully created and donation's allocation amount updated with amount $"175"
  164.  
  165. Scenario: I am creating project where the project goal is bigger than the amount of all donations
  166. When I follow "New Project"
  167. Then I should see "Create a Project - Setup Your Project"
  168. And I select "Individual Fundraisers" from "project_campaign_id"
  169. And I should see "Available funding"
  170. And I fill in "project_title" with "First project"
  171. And I fill in "project_project_goal" with "53450"
  172. And I fill in "project_permalink" with "first_project"
  173. And I attach the file "images.jpeg" to "project_photo"
  174. And I fill in "project_description" with "First project description"
  175. And I fill in "project_content" with "First project content"
  176. When I press "Next Step: Allocate Funds"
  177. Then I should see "Unfortunately, goal of your new project exceeds donations amount! Please, define project goal less!"
  178.  
  179. Scenario: I am creating project without required data
  180. When I follow "New Project"
  181. Then I should see "Create a Project - Setup Your Project"
  182. And I attach the file "images.jpeg" to "project_photo"
  183. And I fill in "project_description" with "First project description"
  184. And I fill in "project_content" with "First project content"
  185. When I press "Next Step: Allocate Funds"
  186. Then I should see "4 errors prohibited this project from being saved:"
  187. And I should see "Campaign can't be blank"
  188. And I should see "Title can't be blank"
  189. And I should see "Project goal can't be blank"
  190. And I should see "Permalink can't be blank"
Add Comment
Please, Sign In to add comment