diff --git a/spec/controllers/spree/orders_controller_spec.rb b/spec/controllers/spree/orders_controller_spec.rb index 08f2db80f7..d5e709aabe 100644 --- a/spec/controllers/spree/orders_controller_spec.rb +++ b/spec/controllers/spree/orders_controller_spec.rb @@ -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