Skip to content

Commit

Permalink
small improvement to one of the order spec examples
Browse files Browse the repository at this point in the history
  • Loading branch information
David North committed Aug 17, 2010
1 parent 2f55a88 commit eaa0155
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/spec/models/order_spec.rb
Expand Up @@ -155,10 +155,10 @@
context "adding a line item" do
it "should increase the item_total" do
order.reload
old_total = order.item_total.to_i
Fabricate(:line_item, :quantity => 1, :price => 100, :order => order)
order.reload
order.item_total.to_i.should == old_total + 100
lambda do
order.line_items.create Fabricate.attributes_for(:line_item, :quantity => 1, :price => 100)
order.reload
end.should change(order, :item_total).by(100)
end
end

Expand Down

0 comments on commit eaa0155

Please sign in to comment.