Avoid using #allow_any_instance_of

This commit is contained in:
Matt-Yorkley
2021-01-08 11:57:48 +00:00
parent 3b1ad29d20
commit 87b14f0237

View File

@@ -151,7 +151,8 @@ module Api
context "when the order cycle is closed" do
before do
allow_any_instance_of(OrderCycle).to receive(:open?) { false }
allow(controller).to receive(:order_cycle) { order_cycle }
allow(order_cycle).to receive(:open?) { false }
end
# Regression test for https://github.com/openfoodfoundation/openfoodnetwork/issues/6491