Use a completed payment, instead of trying to complete a payment
This commit is contained in:
Gaetan Craig-Riou
2025-01-21 10:51:08 +11:00
parent d7ae91c23e
commit 0ca164a354

View File

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