From 89701316859544b3cefa7773b5673f344e351fa3 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Fri, 21 Dec 2018 15:09:42 +0000 Subject: [PATCH] In restart checkout spec, create failed payment before the valid payment otherwise the failed payment will invalidate the previous payment, even if it is a good one In spree 2, every new payment will invalidate all previous payments in the order See here: https://github.com/openfoodfoundation/spree/commit/c9eebba4f7421ea8f6d5137d2005cb47bd9e5ce8 --- spec/services/restart_checkout_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/services/restart_checkout_spec.rb b/spec/services/restart_checkout_spec.rb index 2be21de8b1..2413408994 100644 --- a/spec/services/restart_checkout_spec.rb +++ b/spec/services/restart_checkout_spec.rb @@ -13,8 +13,8 @@ describe RestartCheckout do context "when the order is in a subsequent state" do let!(:shipment_pending) { create(:shipment, order: order, state: 'pending') } - let!(:payment_checkout) { create(:payment, order: order, state: 'checkout') } let!(:payment_failed) { create(:payment, order: order, state: 'failed') } + let!(:payment_checkout) { create(:payment, order: order, state: 'checkout') } before do order.update_attribute(:state, "payment")