mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Destroy all adjustments on cart empty
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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