Browse Source

Skip to non addresss questions if UPRN unknown

CLDC-2068-request-and-validate-UPRN
Jack S 2 years ago
parent
commit
fc3b5918b2
  1. 4
      app/models/form/sales/pages/address.rb
  2. 6
      app/models/form/sales/pages/property_local_authority.rb
  3. 3
      spec/models/form/sales/pages/property_local_authority_spec.rb

4
app/models/form/sales/pages/address.rb

@ -16,6 +16,8 @@ class Form::Sales::Pages::Address < ::Form::Page
end end
def routed_to?(log, _current_user) def routed_to?(log, _current_user)
log.uprn_confirmed != 1 || log.uprn_known&.zero? return false if log.uprn_known.nil?
log.uprn_confirmed != 1 || log.uprn_known.zero?
end end
end end

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

@ -13,4 +13,10 @@ class Form::Sales::Pages::PropertyLocalAuthority < ::Form::Page
Form::Sales::Questions::PropertyLocalAuthority.new(nil, nil, self), Form::Sales::Questions::PropertyLocalAuthority.new(nil, nil, self),
] ]
end end
def routed_to?(log, _current_user)
return false if log.uprn_known.nil? && form.start_date.year >= 2023
super
end
end end

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

@ -38,4 +38,7 @@ RSpec.describe Form::Sales::Pages::PropertyLocalAuthority, type: :model do
"is_la_inferred" => false, "is_la_inferred" => false,
}]) }])
end end
xit "it has the correct routed_to?" do
end
end end

Loading…
Cancel
Save