Adapt factory completed_order_with_fees to new parent order_with_totals_and_distribution by cleaning up duplicate shipping fees

This commit is contained in:
luisramos0
2019-01-09 23:31:40 +00:00
parent e787a317dc
commit 292f22af4e

View File

@@ -432,6 +432,7 @@ FactoryBot.define do
create(:payment, order: order, amount: order.total, payment_method: payment_method, state: 'checkout')
while !order.completed? do break unless order.next! end
order.updater.update_adjustments # this is required to clean up duplicated shipping fees
end
end