Replace stub with allow in checkout_controller_spec

This commit is contained in:
luisramos0
2018-12-05 15:39:57 +00:00
parent 258287b88d
commit afd243c548

View File

@@ -93,10 +93,10 @@ describe CheckoutController, type: :controller do
allow(ResetOrderService).to receive(:new).with(controller, order) { reset_order_service }
allow(reset_order_service).to receive(:call)
allow(order).to receive(:update_attributes).and_return true
controller.stub(:current_order).and_return(order)
allow(controller).to receive(:current_order).and_return order
# make order workflow pass through delivery
order.stub(:next).twice do
allow(order).to receive(:next).twice do
if order.state == 'cart'
order.update_column :state, 'delivery'
else