From 4f7fdd430f5f49f8c3a653da154771bb529ca8cd Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Wed, 8 Jan 2014 11:58:53 +1100 Subject: [PATCH] Update failing controller spec - order needs distributor set --- spec/controllers/spree/orders_controller_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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