Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Feature: Create project
- As a admin of Donately
- I want to create project
- Background:
- # Creating admin
- Given a admin exists with an email address of "admin@donately.com"
- # Creating campaigns
- And a campaign exists with title "Individual Fundraisers" and goal $"10000"
- And a campaign exists with title "Water Activists" and goal $"15000"
- # Creating donors
- And a user exists with full name "John Garret" and email "john.garret@mail.com"
- And a user exists with full name "Ashley Simpson" and email "ashley.simpson@mail.com"
- And a user exists with full name "Steewe Ostin" and email "steewe.ostin@mail.com"
- And a user exists with full name "Jessica Parker" and email "jessica.parker@mail.com"
- And a user exists with full name "Tony Machete" and email "tony.machete@mail.com"
- And a user exists with full name "Dan Balan" and email "dan.balan@mail.com"
- And a user exists with full name "Chris Deburg" and email "chris.deburg@mail.com"
- And a user exists with full name "Holly Dolly" and email "holly.dolly@mail.com"
- # Creating fundraisers (closed and opened)
- 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"
- 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"
- # Creating general campaign donations
- And "John Garret" created one time general campaign donation for campaign "Individual Fundraisers" with amount $"500"
- And "Dan Balan" created one time general campaign donation for campaign "Individual Fundraisers" with amount $"300"
- And "Steewe Ostin" created one time general campaign donation for campaign "Individual Fundraisers" with amount $"1300"
- # Creating fundraiser donations
- And "Jessica Parker" created one time fundraiser donation for fundraiser "John Garret's water" with amount $"1000"
- And "Tony Machete" created one time fundraiser donation for fundraiser "John Garret's water" with amount $"1500"
- And "Ashley Simpson" created one time fundraiser donation for fundraiser "Ashlie's water" with amount $"1500"
- # Creating general account donations
- And "Chris Deburg" created one time general account donation with amount $"500"
- And "Holly Dolly" created one time general account donation with amount $"700"
- # Login as admin and go to projects page
- And I am logged in as admin with email "admin@donately.com"
- And I am on the projects page
- Scenario: I view projects page
- And I should see "Listing projects"
- Scenario: I'm creating project with valid data and using general account donations
- When I follow "New Project"
- Then I should see "Create a Project - Setup Your Project"
- And I select "Individual Fundraisers" from "project_campaign_id"
- And I click on general donations button for using general account donations too
- And I should see "Available funding"
- And I fill in "project_title" with "First project"
- And I fill in "project_project_goal" with "5250"
- And I fill in "project_permalink" with "first_project"
- And I attach the file "images.jpeg" to "project_photo"
- And I fill in "project_description" with "First project description"
- And I fill in "project_content" with "First project content"
- When I press "Next Step: Allocate Funds"
- Then I should see "ALLOCATION SNAPSHOT COMPLETED 100% Currently you have allocated $5250.0 of $5250.0 Using 7 donors and 1 fundraisers"
- When I press "Next Step: Review and Submit"
- Then I should see "Create a Project - Review And Submit"
- And I should see "Project Funding: You have allocated $5250 for this project using 7 donors and 1 fundraisers"
- And I should see "Title: First project"
- And I should see "Project URL: first_project"
- And I should see "Campaign that this project belongs to: Individual Fundraisers"
- And I should see "Goal $5250"
- And I should see "Funded $5250"
- When I press "Submit Project"
- Then I should see "Congratulations! Your project has been created!"
- And I should see "Campaign: Individual Fundraisers"
- And I should see "Title: First project"
- And I should see "Funded: $5250"
- And project named "First project" is created for campaign "Individual Fundraisers" with permalink "first_project" and goal "5250"
- 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"
- 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"
- 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"
- 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"
- 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"
- 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"
- 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"
- Scenario: I'm creating project with valid data and excepting general account donations
- When I follow "New Project"
- Then I should see "Create a Project - Setup Your Project"
- And I select "Individual Fundraisers" from "project_campaign_id"
- And I should see "Available funding"
- And I fill in "project_title" with "First project"
- And I fill in "project_project_goal" with "5250"
- And I fill in "project_permalink" with "first_project"
- When I press "Next Step: Allocate Funds"
- Then I should see "Unfortunately, goal of your new project exceeds donations amount! Please, define project goal less!"
- And I select "Individual Fundraisers" from "project_campaign_id"
- And I should see "Available funding"
- And I fill in "project_title" with "First project"
- And I fill in "project_project_goal" with "4500"
- And I fill in "project_permalink" with "first_project"
- When I press "Next Step: Allocate Funds"
- Then I should see "ALLOCATION SNAPSHOT COMPLETED 100% Currently you have allocated $4500.0 of $4500.0 Using 5 donors and 1 fundraisers"
- When I press "Next Step: Review and Submit"
- Then I should see "Create a Project - Review And Submit"
- And I should see "Project Funding: You have allocated $4500 for this project using 5 donors and 1 fundraisers"
- And I should see "Title: First project"
- And I should see "Project URL: first_project"
- And I should see "Campaign that this project belongs to: Individual Fundraisers"
- And I should see "Goal $4500"
- And I should see "Funded $4500"
- When I press "Submit Project"
- Then I should see "Congratulations! Your project has been created!"
- And I should see "Campaign: Individual Fundraisers"
- And I should see "Title: First project"
- And I should see "Funded: $4500"
- And project named "First project" is created for campaign "Individual Fundraisers" with permalink "first_project" and goal "4500"
- 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"
- 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"
- 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"
- 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"
- 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"
- Scenario: I am creating project with manual selecting and spliting donations
- When I follow "New Project"
- Then I should see "Create a Project - Setup Your Project"
- And I select "Individual Fundraisers" from "project_campaign_id"
- And I click on general donations button for using general account donations too
- And I should see "Available funding"
- And I fill in "project_title" with "First project"
- And I fill in "project_project_goal" with "2175"
- And I fill in "project_permalink" with "first_project"
- And I attach the file "images.jpeg" to "project_photo"
- And I fill in "project_description" with "First project description"
- And I fill in "project_content" with "First project content"
- When I press "Next Step: Allocate Funds"
- Then I should see "ALLOCATION SNAPSHOT COMPLETED 100% Currently you have allocated $2175.0 of $2175.0 Using 4 donors and 1 fundraisers"
- And I uncheck donation, created by "John Garret" with amount $"500"
- And I uncheck donation, created by "Dan Balan" with amount $"300"
- And I uncheck donation, created by "Steewe Ostin" with amount $"1300"
- And I uncheck donation, created by "Jessica Parker" with amount $"1000"
- And I check donation, created by "Tony Machete" with amount $"1500"
- And I check donation, created by "Chris Deburg" with amount $"500"
- And I check donation, created by "Holly Dolly" with amount $"700"
- And I split donation, created by "Holly Dolly" with amount $"700", with value $"175"
- When I press "Next Step: Review and Submit"
- Then I should see "Create a Project - Review And Submit"
- And I should see "Project Funding: You have allocated $2175 for this project using 3 donors and 1 fundraisers"
- And I should see "Title: First project"
- And I should see "Project URL: first_project"
- And I should see "Campaign that this project belongs to: Individual Fundraisers"
- And I should see "Goal $2175"
- And I should see "Funded $2175"
- When I press "Submit Project"
- Then I should see "Congratulations! Your project has been created!"
- And I should see "Campaign: Individual Fundraisers"
- And I should see "Title: First project"
- And I should see "Funded: $2175"
- And project named "First project" is created for campaign "Individual Fundraisers" with permalink "first_project" and goal "2175"
- 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"
- 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"
- 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"
- 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"
- 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"
- 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"
- 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"
- Scenario: I am creating project where the project goal is bigger than the amount of all donations
- When I follow "New Project"
- Then I should see "Create a Project - Setup Your Project"
- And I select "Individual Fundraisers" from "project_campaign_id"
- And I should see "Available funding"
- And I fill in "project_title" with "First project"
- And I fill in "project_project_goal" with "53450"
- And I fill in "project_permalink" with "first_project"
- And I attach the file "images.jpeg" to "project_photo"
- And I fill in "project_description" with "First project description"
- And I fill in "project_content" with "First project content"
- When I press "Next Step: Allocate Funds"
- Then I should see "Unfortunately, goal of your new project exceeds donations amount! Please, define project goal less!"
- Scenario: I am creating project without required data
- When I follow "New Project"
- Then I should see "Create a Project - Setup Your Project"
- And I attach the file "images.jpeg" to "project_photo"
- And I fill in "project_description" with "First project description"
- And I fill in "project_content" with "First project content"
- When I press "Next Step: Allocate Funds"
- Then I should see "4 errors prohibited this project from being saved:"
- And I should see "Campaign can't be blank"
- And I should see "Title can't be blank"
- And I should see "Project goal can't be blank"
- And I should see "Permalink can't be blank"
Add Comment
Please, Sign In to add comment