From 867cd4641e545f90852d258fc2d09ecca10f9202 Mon Sep 17 00:00:00 2001 From: Seb Ashton Date: Tue, 13 Sep 2016 08:33:32 +0100 Subject: [PATCH] Move source into a let --- .../controllers/spree/api/adyen_redirect_controller_spec.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spec/controllers/spree/api/adyen_redirect_controller_spec.rb b/spec/controllers/spree/api/adyen_redirect_controller_spec.rb index 5fbae42b..c29e8861 100644 --- a/spec/controllers/spree/api/adyen_redirect_controller_spec.rb +++ b/spec/controllers/spree/api/adyen_redirect_controller_spec.rb @@ -107,11 +107,9 @@ merchant_reference: order.number) end - # there will already be a payment and source created at this point - before do - source = - create(:hpp_source, psp_reference: psp_reference, order: order) + let(:source) { create(:hpp_source, psp_reference: psp_reference, order: order) } + before do create(:hpp_payment, source: source, order: order) order.contents.advance