From 99cd48a5ad252de558dfe75e884ca91b36071428 Mon Sep 17 00:00:00 2001 From: Jack S Date: Wed, 23 Nov 2022 13:01:29 +0000 Subject: [PATCH] Show ManagingOrganisation if managing agents >=1 --- app/models/form/lettings/pages/managing_organisation.rb | 2 +- .../form/lettings/pages/managing_organisation_spec.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/form/lettings/pages/managing_organisation.rb b/app/models/form/lettings/pages/managing_organisation.rb index 4006a3fb3..bc8534999 100644 --- a/app/models/form/lettings/pages/managing_organisation.rb +++ b/app/models/form/lettings/pages/managing_organisation.rb @@ -25,6 +25,6 @@ class Form::Lettings::Pages::ManagingOrganisation < ::Form::Page return false unless organisation return true unless organisation.holds_own_stock? - organisation.managing_agents.count > 1 + organisation.managing_agents.count >= 1 end end diff --git a/spec/models/form/lettings/pages/managing_organisation_spec.rb b/spec/models/form/lettings/pages/managing_organisation_spec.rb index 3a5aa1c8d..65c2589c6 100644 --- a/spec/models/form/lettings/pages/managing_organisation_spec.rb +++ b/spec/models/form/lettings/pages/managing_organisation_spec.rb @@ -97,8 +97,8 @@ RSpec.describe Form::Lettings::Pages::ManagingOrganisation, type: :model do ) end - it "is not shown" do - expect(page.routed_to?(log, user)).to eq(false) + it "is shown" do + expect(page.routed_to?(log, user)).to eq(true) end end end @@ -149,8 +149,8 @@ RSpec.describe Form::Lettings::Pages::ManagingOrganisation, type: :model do ) end - it "is not shown" do - expect(page.routed_to?(log, user)).to eq(false) + it "is shown" do + expect(page.routed_to?(log, user)).to eq(true) end end end