Marcelo wrote: > I have 3 models: Store, Product and Item > > How do i get this test to pass? > > it "should update item's quantity" do > Item.create(:product_id => 1, :store_id => 1, :quantity => 1) > Item.create(:product_id => 1, :store_id => 1, :quantity => 1) > Item.first.quantity.should eql(2) > end > > I have a better picture of the situation on Pastie: > http://pastie.org/997850
> it "should update item's quantity" do > Item.create_or_update_quantity(:product_id => 1, :store_id => 1, > :quantity => 1) > Item.create_or_update_quantity(:product_id => 1, :store_id => 1, > :quantity => 1) > Item.first.quantity.should eql(2) > end Then write the missing method. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

