Fix intermittent 500 error when updating the cart

This commit is contained in:
Rohan Mitchell
2015-03-13 17:50:01 +11:00
parent abaaf05631
commit 8d3f25bb39
2 changed files with 6 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ Spree::TaxRate.class_eval do
def adjust_with_included_tax(order)
adjust_without_included_tax(order)
order.reload
(order.adjustments.tax + order.price_adjustments).each do |a|
a.set_absolute_included_tax! a.amount
end

View File

@@ -23,6 +23,11 @@ module Spree
adjustment.amount.should be > 0
adjustment.included_tax.should == adjustment.amount
end
it "does not crash when order data has been updated previously" do
order.price_adjustments.first.destroy
tax_rate.adjust(order)
end
end
describe "Shipment adjustments" do