mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #9190 from georgethoppil/duplicate-transaction-fees
Destroy all adjustments on cart empty
This commit is contained in:
@@ -430,9 +430,10 @@ module Spree
|
||||
|
||||
def empty!
|
||||
line_items.destroy_all
|
||||
adjustments.destroy_all
|
||||
all_adjustments.destroy_all
|
||||
payments.clear
|
||||
shipments.destroy_all
|
||||
restart_checkout_flow if state == "payment"
|
||||
end
|
||||
|
||||
def state_changed(name)
|
||||
|
||||
@@ -315,7 +315,7 @@ describe Spree::Order do
|
||||
allow(order).to receive_messages(line_items: line_items = [])
|
||||
allow(order).to receive_messages(adjustments: adjustments = [])
|
||||
expect(order.line_items).to receive(:destroy_all)
|
||||
expect(order.adjustments).to receive(:destroy_all)
|
||||
expect(order.all_adjustments).to receive(:destroy_all)
|
||||
|
||||
order.empty!
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user