From 0b497fbb778cf78d0a2e4fd413e82baddf28622c Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Tue, 2 Dec 2025 16:09:47 +1100 Subject: [PATCH] Fix order payment spec --- spec/models/spree/order/payment_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/models/spree/order/payment_spec.rb b/spec/models/spree/order/payment_spec.rb index a3527849ba..3c61d7fe93 100644 --- a/spec/models/spree/order/payment_spec.rb +++ b/spec/models/spree/order/payment_spec.rb @@ -35,6 +35,12 @@ module Spree } before do + # mock the call with "ofn.payment_transition" so we don't call the related listener + # and services + allow(ActiveSupport::Notifications).to receive(:instrument).and_call_original + allow(ActiveSupport::Notifications).to receive(:instrument) + .with("ofn.payment_transition", any_args).and_return(nil) + allow(order).to receive_message_chain(:line_items, :empty?).and_return(false) allow(order).to receive_messages total: 100 stub_request(:get, "https://api.stripe.com/v1/payment_intents/12345").