Browse Source

Do not route to LA question when inferred

CLDC-2213-do-not-display-local-authority-question-if-inferred
Jack S 2 years ago
parent
commit
ae6e832e6d
  1. 1
      app/models/form/sales/pages/property_local_authority.rb
  2. 10
      spec/models/form/sales/pages/property_local_authority_spec.rb

1
app/models/form/sales/pages/property_local_authority.rb

@ -16,6 +16,7 @@ class Form::Sales::Pages::PropertyLocalAuthority < ::Form::Page
def routed_to?(log, _current_user = nil) def routed_to?(log, _current_user = nil)
return false if log.uprn_known.nil? && form.start_date.year >= 2023 return false if log.uprn_known.nil? && form.start_date.year >= 2023
return false if log.is_la_inferred?
true true
end end

10
spec/models/form/sales/pages/property_local_authority_spec.rb

@ -83,6 +83,16 @@ RSpec.describe Form::Sales::Pages::PropertyLocalAuthority, type: :model do
it "returns true" do it "returns true" do
expect(page.routed_to?(log)).to eq(false) expect(page.routed_to?(log)).to eq(false)
end end
context "when is_la_inferred: true" do
before do
allow(log).to receive(:is_la_inferred?).and_return(true)
end
it "returns true" do
expect(page.routed_to?(log)).to eq(false)
end
end
end end
end end
end end

Loading…
Cancel
Save