mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Update failing controller spec - order needs distributor set
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user