From 0ca164a3542532f366b9358997dc6c34cf8ca16e Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Tue, 21 Jan 2025 10:51:08 +1100 Subject: [PATCH] Fix spec Use a completed payment, instead of trying to complete a payment --- spec/controllers/admin/customers_controller_spec.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spec/controllers/admin/customers_controller_spec.rb b/spec/controllers/admin/customers_controller_spec.rb index d8d464fcb0..3353dcb447 100644 --- a/spec/controllers/admin/customers_controller_spec.rb +++ b/spec/controllers/admin/customers_controller_spec.rb @@ -83,13 +83,9 @@ module Admin let!(:variant) { create(:variant, price: 10.0) } before do - allow_any_instance_of(Spree::Payment).to receive(:completed?).and_return(true) - order.contents.add(variant) - order.payments << create(:payment, order:, amount: order.total) - order.reload + order.payments << create(:payment, :completed, order:, amount: order.total) - order.process_payments! order.update_attribute(:state, 'canceled') end