Destroy all adjustments on cart empty

This commit is contained in:
georgethoppil
2022-05-16 19:50:16 -04:00
parent aafa416b9c
commit 03b24bfc38
2 changed files with 2 additions and 2 deletions

View File

@@ -430,7 +430,7 @@ module Spree
def empty!
line_items.destroy_all
adjustments.destroy_all
all_adjustments.destroy_all
payments.clear
shipments.destroy_all
end

View File

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