From 33face83c5fc2e6ece32bdf18133702455412edf Mon Sep 17 00:00:00 2001 From: Kat <54268893+kosiakkatrina@users.noreply.github.com> Date: Fri, 15 Nov 2024 08:35:30 +0000 Subject: [PATCH] Update no address found soft validation --- app/models/form/lettings/pages/no_address_found.rb | 5 +++-- .../locales/forms/2024/lettings/soft_validations.en.yml | 8 ++++++++ spec/models/form/lettings/pages/no_address_found_spec.rb | 7 ++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/models/form/lettings/pages/no_address_found.rb b/app/models/form/lettings/pages/no_address_found.rb index b1a78caf6..631d6f58e 100644 --- a/app/models/form/lettings/pages/no_address_found.rb +++ b/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 = [ diff --git a/config/locales/forms/2024/lettings/soft_validations.en.yml b/config/locales/forms/2024/lettings/soft_validations.en.yml index ada093d39..b4a76af04 100644 --- a/config/locales/forms/2024/lettings/soft_validations.en.yml +++ b/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." diff --git a/spec/models/form/lettings/pages/no_address_found_spec.rb b/spec/models/form/lettings/pages/no_address_found_spec.rb index ad8c04e04..1825d4d30 100644 --- a/spec/models/form/lettings/pages/no_address_found_spec.rb +++ b/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