mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-06 07:29:16 +00:00
@@ -201,7 +201,7 @@ module Spree
|
||||
end
|
||||
|
||||
def update_order
|
||||
if completed?
|
||||
if completed? || void?
|
||||
order.updater.update_payment_total
|
||||
end
|
||||
|
||||
|
||||
@@ -546,6 +546,15 @@ describe Spree::Payment do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the payment was completed but now void' do
|
||||
let(:payment) { create(:payment, amount: 100, order: order, state: 'completed') }
|
||||
|
||||
it 'updates order payment total' do
|
||||
payment.void
|
||||
expect(order.payment_total).to eq 0
|
||||
end
|
||||
end
|
||||
|
||||
context "completed orders" do
|
||||
before { allow(order).to receive(:completed?) { true } }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user