From efcb442a80359f6bfad711a5271973bb96984ecf Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Tue, 2 Dec 2025 15:11:40 +1100 Subject: [PATCH] Add spec to test notification is triggered --- spec/models/spree/payment_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/models/spree/payment_spec.rb b/spec/models/spree/payment_spec.rb index 7f060f0b13..6b7dda5d04 100644 --- a/spec/models/spree/payment_spec.rb +++ b/spec/models/spree/payment_spec.rb @@ -1071,4 +1071,17 @@ RSpec.describe Spree::Payment do expect(payment.captured_at).to be_present end end + + describe "payment transition" do + it "notifies of payment status change" do + payment = create(:payment) + + allow(ActiveSupport::Notifications).to receive(:instrument).and_call_original + expect(ActiveSupport::Notifications).to receive(:instrument).with( + "ofn.payment_transition", payment: payment, event: "processing" + ) + + payment.started_processing! + end + end end