diff --git a/spec/services/checkout/stripe_redirect_spec.rb b/spec/services/checkout/stripe_redirect_spec.rb index 05b46dfe25..6d5830e3c9 100644 --- a/spec/services/checkout/stripe_redirect_spec.rb +++ b/spec/services/checkout/stripe_redirect_spec.rb @@ -38,6 +38,8 @@ describe Checkout::StripeRedirect do it "returns the redirect path" do stripe_payment = create(:payment, payment_method_id: payment_method.id) order.payments << stripe_payment + allow(OrderPaymentFinder).to receive_message_chain(:new, :last_pending_payment). + and_return(stripe_payment) allow(stripe_payment).to receive(:authorize!) do # Authorization moves the payment state from checkout/processing to pending stripe_payment.state = 'pending'