In rails 4 we need to update the stub after we update the order.user otherwise the stub will return the previous value

This commit is contained in:
Luis Ramos
2020-03-04 15:50:52 +00:00
parent 829a73c58d
commit 415415273c

View File

@@ -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