Update failing controller spec - order needs distributor set

This commit is contained in:
Rohan Mitchell
2014-01-08 11:58:53 +11:00
parent df53a14d4b
commit 4f7fdd430f

View File

@@ -102,11 +102,12 @@ describe Spree::OrdersController do
p = create(:product, :distributors => [distributor_product], :group_buy => true)
order = subject.current_order(true)
order.stub(:distributor) { distributor_product }
order.should_receive(:set_variant_attributes).with(p.master, {'max_quantity' => '3'})
controller.stub(:current_order).and_return(order)
expect do
spree_post :populate, :variants => {p.master.id => 1}, :variant_attributes => {p.master.id => {:max_quantity => 3}}, :distributor_id => distributor_product.id
spree_post :populate, :variants => {p.master.id => 1}, :variant_attributes => {p.master.id => {:max_quantity => 3}}
end.to change(Spree::LineItem, :count).by(1)
end
end