Skip to content

Commit 5f3cb16

Browse files
committed
added test
1 parent 65d2d48 commit 5f3cb16

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

features/donations/monthly_donation_user_view.feature

+8-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ Background:
44
Given I am logged in as customer "Tom Foolery"
55
Given admin "has" allowed recurring donations
66
And I go to the quick donation page
7-
8-
@stubs_successful_credit_card_payment
9-
Scenario: make donation
107
Then I should see "frequency"
118
When I select monthly in the donation frequency radio button
129
When I fill in "Donation amount" with "15"
10+
11+
@stubs_successful_credit_card_payment
12+
Scenario: make donation
1313
And I press "Charge Donation to Credit Card"
1414
Then I should see "You have paid a total of $15.00 by Credit card"
1515
Then there should be a Recurring Donation model instance belonging to "Tom Foolery"
16-
16+
17+
@stubs_failed_credit_card_payment
18+
Scenario: attempt to make a donation but card payment fails
19+
And I press "Charge Donation to Credit Card"
20+
Then there should not be a Recurring Donation model instance belonging to "Tom Foolery"

features/step_definitions/option_steps.rb

+3
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,6 @@
7272
expect(c.first_name).to eq(first)
7373
expect(c.last_name).to eq(last)
7474
end
75+
Then /there should not be a Recurring Donation model instance belonging to "(.*) (.*)"$/ do |first,last|
76+
expect(RecurringDonation.first).to eq(nil)
77+
end

0 commit comments

Comments
 (0)