From f9f398d3b9ff3383aacf60483decf7bfd3a7bc00 Mon Sep 17 00:00:00 2001 From: James Gayfer Date: Wed, 28 Mar 2018 08:42:49 -0700 Subject: [PATCH] Fix invalid Payment in Spree::Payment spec While this spec will pass, any additional attempts to save the payment in question would fail as the Payment was not able to save on create due to it being invalid (missing a source). --- core/spec/models/spree/payment_spec.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/core/spec/models/spree/payment_spec.rb b/core/spec/models/spree/payment_spec.rb index d482826c2b6..d40f751b8a0 100644 --- a/core/spec/models/spree/payment_spec.rb +++ b/core/spec/models/spree/payment_spec.rb @@ -668,12 +668,9 @@ end context 'when the payment was completed but now void' do - let(:payment) do - Spree::Payment.create( - amount: 100, - order: order, - state: 'completed' - ) + before do + payment.state = 'completed' + payment.amount = 100 end it 'updates order payment total' do