Browse Source

Update no address found soft validation

pull/2763/head
Kat 9 months ago
parent
commit
33face83c5
  1. 5
      app/models/form/lettings/pages/no_address_found.rb
  2. 8
      config/locales/forms/2024/lettings/soft_validations.en.yml
  3. 7
      spec/models/form/lettings/pages/no_address_found_spec.rb

5
app/models/form/lettings/pages/no_address_found.rb

@ -3,12 +3,13 @@ class Form::Lettings::Pages::NoAddressFound < ::Form::Page
super
@id = "no_address_found"
@type = "interruption_screen"
@copy_key = "lettings.soft_validations.no_address_found"
@title_text = {
"translation" => "soft_validations.no_address_found.title_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text",
"arguments" => [],
}
@informative_text = {
"translation" => "soft_validations.no_address_found.informative_text",
"translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text",
"arguments" => [],
}
@depends_on = [

8
config/locales/forms/2024/lettings/soft_validations.en.yml

@ -130,3 +130,11 @@ en:
question_text: "Are you sure the property has been vacant for this long?"
title_text: "You told us the property has been vacant for 2 years."
informative_text: "This is longer than we would expect."
no_address_found:
page_header: ""
check_answer_label: "No address found"
hint_text: ""
question_text: "We could not find an address that matches your search. You can search again or continue to enter the address manually."
title_text: "No address found"
informative_text: "We could not find an address that matches your search. You can search again or continue to enter the address manually."

7
spec/models/form/lettings/pages/no_address_found_spec.rb

@ -5,7 +5,8 @@ RSpec.describe Form::Lettings::Pages::NoAddressFound, type: :model do
let(:page_id) { nil }
let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) }
let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
let(:log) { create(:lettings_log) }
it "has correct subsection" do
@ -37,11 +38,11 @@ RSpec.describe Form::Lettings::Pages::NoAddressFound, type: :model do
end
it "has the correct title_text" do
expect(page.title_text).to eq({ "arguments" => [], "translation" => "soft_validations.no_address_found.title_text" })
expect(page.title_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.no_address_found.title_text" })
end
it "has the correct informative_text" do
expect(page.informative_text).to eq({ "arguments" => [], "translation" => "soft_validations.no_address_found.informative_text" })
expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.no_address_found.informative_text" })
end
it "has the correct interruption_screen_question_ids" do

Loading…
Cancel
Save