Browse Source

Show ManagingOrganisation if managing agents >=1

CLDC-20-more-ac-fixes3
Jack S 2 years ago
parent
commit
99cd48a5ad
  1. 2
      app/models/form/lettings/pages/managing_organisation.rb
  2. 8
      spec/models/form/lettings/pages/managing_organisation_spec.rb

2
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

8
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

Loading…
Cancel
Save