Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
rnickles committed Apr 27, 2024
1 parent 65d2d48 commit 5f3cb16
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 8 additions & 4 deletions features/donations/monthly_donation_user_view.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ Background:
Given I am logged in as customer "Tom Foolery"
Given admin "has" allowed recurring donations
And I go to the quick donation page

@stubs_successful_credit_card_payment
Scenario: make donation
Then I should see "frequency"
When I select monthly in the donation frequency radio button
When I fill in "Donation amount" with "15"

@stubs_successful_credit_card_payment
Scenario: make donation
And I press "Charge Donation to Credit Card"
Then I should see "You have paid a total of $15.00 by Credit card"
Then there should be a Recurring Donation model instance belonging to "Tom Foolery"


@stubs_failed_credit_card_payment
Scenario: attempt to make a donation but card payment fails
And I press "Charge Donation to Credit Card"
Then there should not be a Recurring Donation model instance belonging to "Tom Foolery"
3 changes: 3 additions & 0 deletions features/step_definitions/option_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,6 @@
expect(c.first_name).to eq(first)
expect(c.last_name).to eq(last)
end
Then /there should not be a Recurring Donation model instance belonging to "(.*) (.*)"$/ do |first,last|
expect(RecurringDonation.first).to eq(nil)
end

0 comments on commit 5f3cb16

Please sign in to comment.