Get tests broken because of new order cycle shipping method validations working again

This commit is contained in:
Cillian O'Ruanaidh
2022-06-08 21:28:37 +01:00
committed by Filipe
parent a46b77d10c
commit 4e0bf75ecf
17 changed files with 134 additions and 70 deletions

View File

@@ -10,7 +10,7 @@ module OpenFoodNetwork
let(:producer) { create(:supplier_enterprise) }
let(:user) { double(:user) }
let(:oc) { create(:simple_order_cycle, coordinator: coordinator) }
let(:permissions) { OrderCyclePermissions.new(user, oc) }
let(:permissions) { OrderCyclePermissions.new(user, oc.reload) }
describe "finding enterprises that can be viewed in the order cycle interface" do
context "when permissions are initialized without an order_cycle" do
@@ -53,7 +53,7 @@ module OpenFoodNetwork
end
context "where the coordinator sells 'own'" do
before { allow(coordinator).to receive(:sells) { 'own' } }
before { allow(oc.coordinator).to receive(:sells) { 'own' } }
it "returns just the coordinator" do
enterprises = permissions.visible_enterprises
expect(enterprises).to_not include hub, producer
@@ -80,7 +80,7 @@ module OpenFoodNetwork
end
context "where the coordinator sells 'own'" do
before { allow(coordinator).to receive(:sells) { 'own' } }
before { allow(oc.coordinator).to receive(:sells) { 'own' } }
it "returns just the coordinator" do
enterprises = permissions.visible_enterprises
expect(enterprises).to_not include hub, producer