Skip to content

Commit

Permalink
Small edit
Browse files Browse the repository at this point in the history
  • Loading branch information
PratyushSharma14 committed Mar 11, 2024
1 parent 6f71dc2 commit cfdf737
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 5 additions & 1 deletion features/donations/monthly_donation_admin_view.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ Scenario: Allow Monthly Recurring Donations
Then the radio button to select the default donation type should be set to "one"
And I press "Update Settings"
Then I should see "Update successful"
When I go to the quick donation page
Then I should see "frequency"

Scenario: Disallow Monthly Recurring Donations
When I visit the admin:settings page
And I set allow recurring donations to "No"
Then the radio button to select the default donation type should be "hidden"
And I press "Update Settings"
Then I should see "Update successful"
Then I should see "Update successful"
When I go to the quick donation page
Then I should not see "frequency"
3 changes: 1 addition & 2 deletions features/donations/monthly_donation_user_view.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ Scenario: make donation
When I fill in "Donation amount" with "15"
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

Then there should be a Recurring Donation model instance belonging to "Tom Foolery"
10 changes: 7 additions & 3 deletions features/step_definitions/option_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
# Step defintions for testing the recurring donation feature user view
#####

Given /admin has not allowed recurring donations/ do
Option.first.update_attributes!(:allow_recurring_donations => false)
end

Given /admin has allowed recurring donations/ do
Option.first.update_attributes!(:allow_recurring_donations => true)
end
Expand All @@ -71,11 +75,11 @@
radio_button.choose("Monthly")
end

Then /there should be a Recurring Donation model instance belonging to Tom Foolery/ do
Then /there should be a Recurring Donation model instance belonging to "(.*) (.*)"$/ do |first,last|
r = RecurringDonation.first
c = Customer.find(r.customer_id)
expect(c.first_name).to eq("Tom")
expect(c.last_name).to eq("Foolery")
expect(c.first_name).to eq(first)
expect(c.last_name).to eq(last)
end


0 comments on commit cfdf737

Please sign in to comment.