From 415415273cdaebe93bfdc926f58fceaf492ec1b4 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Wed, 4 Mar 2020 15:50:52 +0000 Subject: [PATCH] In rails 4 we need to update the stub after we update the order.user otherwise the stub will return the previous value --- spec/controllers/line_items_controller_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/controllers/line_items_controller_spec.rb b/spec/controllers/line_items_controller_spec.rb index 2a4dbd8835..31d890a80a 100644 --- a/spec/controllers/line_items_controller_spec.rb +++ b/spec/controllers/line_items_controller_spec.rb @@ -59,7 +59,10 @@ describe LineItemsController, type: :controller do end context "where the item's order is associated with the current user" do - before { order.update_attributes!(user_id: user.id) } + before do + order.update_attributes!(user_id: user.id) + allow(controller).to receive_messages spree_current_user: item.order.user + end context "without an order cycle or distributor" do it "denies deletion" do