Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added test #18

Merged

Conversation

rnickles
Copy link

@rnickles rnickles commented Apr 27, 2024

ok, so basically a recurring donation when first set up causes both a regular donation to be processed and a new record to be added to RecurringDonations table? so questions: (a) for the Cuke test that tests this, can you use @stubs_successful_credit_card_payment (see features/support/env.rb) rather than stubbing Stripe::Charge.create
directly; and (b) are there tests for the failure cases? handling failures on this is really important:
(a) what if the stripe charge fails? (the recurring donation should not be created, and the donation should not be recorded)
(b) what if creating the recurring donation fails? (the stripe charge should not occur for the initial donation)
not sure i saw scenarios/specs that covered the sad paths but they are pretty important... they can be a separate PR but i'm reluctant to incorporate code whose failure behavior is so critical unless the tests are pretty thorough....

Attempted to handle Armando's requests.

  • We are already using @stubs_successful_credit_card_payment
  • I think I solved (a)
  • Not sure about (b)

Run the test with:
RUBYOPT="-W0" bundle exec cucumber features/donations/monthly_donation_user_view.feature

@winsonwan
Copy link

lgtm

@winsonwan winsonwan merged commit aef99ae into 187065217-perform-recurring-donation-transaction Apr 28, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants