Files
danbooru/test/test_helpers/stripe_test_helper.rb
evazion 449fd6c49c upgrades: factor out Stripe integration.
Factor out the Stripe code from the UserUpgrade class. Introduce a new
PaymentTransaction abstract class that represents a payment with some
payment processor, and a PaymentTransaction::Stripe class that
implements transactions with Stripe.

Note that we can't completely eliminate Stripe even though we no longer
accept payments with it because we still need to be able to look up old
payments in Stripe.
2022-05-06 22:52:33 -05:00

14 lines
297 B
Ruby

StripeMock.webhook_fixture_path = "test/fixtures/stripe-webhooks"
module StripeTestHelper
def mock_stripe!
setup do
StripeMock.start unless PaymentTransaction::Stripe.enabled?
end
teardown do
StripeMock.stop unless PaymentTransaction::Stripe.enabled?
end
end
end