Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Fixes issue that causes order totals to be stale after callin…

…g Order#add_variant."

This reverts commit 7868902.

Re-opens #1595
  • Loading branch information...
commit 163cdde3763c0b03071bdbb26d18e649782c85c4 1 parent 0a995c0
@radar radar authored
View
2  core/app/models/spree/order.rb
@@ -287,8 +287,6 @@ def add_variant(variant, quantity = 1)
current_item.price = variant.price
self.line_items << current_item
end
-
- self.reload
current_item
end
View
14 core/spec/models/order_spec.rb
@@ -992,18 +992,4 @@ def compute(computable)
end
end
- context "#add_variant" do
- it "should update order totals" do
- order = Spree::Order.create!
-
- order.item_total.to_f.should == 0.00
- order.total.to_f.should == 0.00
-
- product = Spree::Product.create!(:name => 'Test', :sku => 'TEST-1', :price => 22.25)
- order.add_variant(product.master)
-
- order.item_total.to_f.should == 22.25
- order.total.to_f.should == 22.25
- end
- end
end
View
4 core/spec/requests/admin/orders/payments_spec.rb
@@ -38,14 +38,14 @@
click_link "Payments"
within('#payment_status') { page.should have_content("Payment: balance due") }
- find('table.index tbody tr:nth-child(2) td:nth-child(2)').text.should == "$49.98"
+ find('table.index tbody tr:nth-child(2) td:nth-child(2)').text.should == "$39.98"
find('table.index tbody tr:nth-child(2) td:nth-child(3)').text.should == "Credit Card"
find('table.index tbody tr:nth-child(2) td:nth-child(4)').text.should == "pending"
click_button "Void"
within('#payment_status') { page.should have_content("Payment: balance due") }
page.should have_content("Payment Updated")
- find('table.index tbody tr:nth-child(2) td:nth-child(2)').text.should == "$49.98"
+ find('table.index tbody tr:nth-child(2) td:nth-child(2)').text.should == "$39.98"
find('table.index tbody tr:nth-child(2) td:nth-child(3)').text.should == "Credit Card"
find('table.index tbody tr:nth-child(2) td:nth-child(4)').text.should == "void"
Please sign in to comment.
Something went wrong with that request. Please try again.