You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stripe is more or less stable now. The tests in the resource creator have just one success test and the rest of tests are testing what we do when something fails. For the success test and for the failure tests we are doing real requests that are then replayed by VCR.
At the moment we may be in a position where we can avoid those cassettes completely by adding this to each of the parameter tests in resource_creator_spec.rb, right before the call to expect_creation_to_fail_with():
Then we should have a spec/donation_system/integration_spec.rb file in the top level that creates one donation of each type (Stripe one-off, Stripe recurring, PayPal one-off, PayPal recurring, etc.) passing an instance of RawRequestData with the relevant fields for each donation to the Payment object. These tests will then do real requests so we would use VCR or webmock for those tests only (VCR and webmock fixtures are a pain to maintain and add a lot of noise to git, so better to keep them either small or out of the git history completely as we are doing at the moment).
The text was updated successfully, but these errors were encountered:
P.S. Meanwhile, if you ever hit Stripe's 25-subscriptions-per-customer limit, you can use this script:
# frozen_string_literal: truerequire'stripe'Stripe.api_key=ENV['STRIPE_SECRET_KEY']defdeletecustomer_used_in_tests='cus_CAISMYrOdzMtdE'Stripe::Customer.list.data.eachdo |customer|
test_customer=Stripe::Customer.retrieve(customer.id)test_customer.subscriptions.data.each(&:delete)ifcustomer.id == customer_used_in_teststest_customer.deleteunlesscustomer.id == customer_used_in_tests# this is not needed but while you're at it why not clean a bitendend50.times{delete}
See our contributing guides.
Stripe is more or less stable now. The tests in the resource creator have just one success test and the rest of tests are testing what we do when something fails. For the success test and for the failure tests we are doing real requests that are then replayed by VCR.
At the moment we may be in a position where we can avoid those cassettes completely by adding this to each of the parameter tests in
resource_creator_spec.rb
, right before the call toexpect_creation_to_fail_with()
:Then we should have a
spec/donation_system/integration_spec.rb
file in the top level that creates one donation of each type (Stripe one-off, Stripe recurring, PayPal one-off, PayPal recurring, etc.) passing an instance ofRawRequestData
with the relevant fields for each donation to thePayment
object. These tests will then do real requests so we would use VCR or webmock for those tests only (VCR and webmock fixtures are a pain to maintain and add a lot of noise to git, so better to keep them either small or out of the git history completely as we are doing at the moment).The text was updated successfully, but these errors were encountered: