Add spec to test notification is triggered

This commit is contained in:
Gaetan Craig-Riou
2025-12-02 15:11:40 +11:00
parent a38023475c
commit efcb442a80

View File

@@ -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