Displaying 1 result from an estimated 1 matches for "order_item4".
Did you mean:
order_items
2008 Jun 04
2
Mock with an attributes that has state
...ecs on each model and always mock associated models.
In my Order model I need a way to merge OrderItems which have the same cost
and same product_id. That I can spec.
The other thing this merge helper function should do is increment the
quantity of the merged OrderItems. Below @order_item1 and @order_item4
would be merged into one item with a quantity of 2.
Here are my OrderItems mocks:
@order_item1 = mock_model(OrderItem, :valid? => true, :product_id => 1,
:cost => 1, :null_object => true)
@order_item2 = mock_model(OrderItem, :valid? => true, :product_id => 1,
:cost =>...