From 020b8a4f4c14eb7a4bb2e566b3d4ec19f85f0076 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Mon, 11 Nov 2024 14:51:12 +0000 Subject: [PATCH] CLDC-3686 Extract lettings soft validations copy (#2735) * Extract household characteristics soft validations * Extract household needs soft validations * Extract household situation soft validations * Extract income and benefits soft validations * Extract property information soft validations * Update tests and 2024 soft validations * Update some test forms * Re-add sales validation * Update BU tests * Fixes * Change higher to longer * Update model test * Update model test * Add 2025 translations copied from 2024 * Update pregnancy and retirement copy --------- Co-authored-by: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Co-authored-by: Rachael Booth --- app/helpers/interruption_screen_helper.rb | 2 +- .../pages/care_home_charges_value_check.rb | 8 +- ...pregnant_household_lead_age_value_check.rb | 9 +- ...gnant_household_lead_hhmemb_value_check.rb | 9 +- ..._in_pregnant_household_lead_value_check.rb | 9 +- ...egnant_household_person_age_value_check.rb | 21 +-- ...n_pregnant_household_person_value_check.rb | 22 +-- ...range_in_pregnant_household_value_check.rb | 9 +- ...lead_tenant_over_retirement_value_check.rb | 6 +- ...ead_tenant_under_retirement_value_check.rb | 8 +- .../pages/multiple_partners_value_check.rb | 8 +- .../lettings/pages/net_income_value_check.rb | 5 +- ...pregnant_household_lead_age_value_check.rb | 9 +- ...gnant_household_lead_hhmemb_value_check.rb | 9 +- ...les_pregnant_household_lead_value_check.rb | 9 +- ...egnant_household_person_age_value_check.rb | 9 +- ...s_pregnant_household_person_value_check.rb | 9 +- ..._females_pregnant_household_value_check.rb | 9 +- .../pages/partner_under_16_value_check.rb | 8 +- .../person_over_retirement_value_check.rb | 6 +- .../person_under_retirement_value_check.rb | 8 +- .../property_major_repairs_value_check.rb | 5 +- .../lettings/pages/pscharge_value_check.rb | 8 +- .../lettings/pages/reasonother_value_check.rb | 5 +- .../lettings/pages/referral_value_check.rb | 5 +- .../form/lettings/pages/rent_value_check.rb | 5 +- .../lettings/pages/scharge_value_check.rb | 8 +- .../lettings/pages/supcharg_value_check.rb | 8 +- .../lettings/pages/void_date_value_check.rb | 5 +- .../care_home_charges_value_check.rb | 3 +- .../major_repairs_date_value_check.rb | 3 +- .../multiple_partners_value_check.rb | 3 +- .../questions/net_income_value_check.rb | 3 +- .../questions/no_retirement_value_check.rb | 3 +- .../questions/partner_under_16_value_check.rb | 3 +- .../questions/pregnancy_value_check.rb | 3 +- .../questions/pscharge_value_check.rb | 4 +- .../questions/reasonother_value_check.rb | 3 +- .../questions/referral_value_check.rb | 3 +- .../lettings/questions/rent_value_check.rb | 4 +- .../questions/retirement_value_check.rb | 3 +- .../lettings/questions/scharge_value_check.rb | 4 +- .../questions/supcharg_value_check.rb | 4 +- .../questions/void_date_value_check.rb | 3 +- config/forms/2021_2022.json | 4 +- config/forms/2022_2023.json | 4 +- config/locales/en.yml | 45 ------ .../2023/lettings/soft_validations.en.yml | 132 ++++++++++++++++++ .../2024/lettings/soft_validations.en.yml | 132 ++++++++++++++++++ .../2025/lettings/soft_validations.en.yml | 132 ++++++++++++++++++ spec/fixtures/forms/2021_2022.json | 4 +- .../interruption_screen_helper_spec.rb | 2 +- .../care_home_charges_value_check_spec.rb | 4 +- ...t_household_person_age_value_check_spec.rb | 40 ++---- ...gnant_household_person_value_check_spec.rb | 40 ++---- .../multiple_partners_value_check_spec.rb | 11 +- .../pages/net_income_value_check_spec.rb | 4 +- ...t_household_person_age_value_check_spec.rb | 40 ++---- ...gnant_household_person_value_check_spec.rb | 40 ++---- .../pages/partner_under16_value_check_spec.rb | 27 ++-- ...person_over_retirement_value_check_spec.rb | 10 +- ...erson_under_retirement_value_check_spec.rb | 8 +- .../household_characteristics_spec.rb | 2 +- .../subsections/household_needs_spec.rb | 3 +- .../subsections/household_situation_spec.rb | 2 +- .../subsections/income_and_benefits_spec.rb | 3 +- .../lettings/year2023/row_parser_spec.rb | 4 +- .../lettings/year2024/row_parser_spec.rb | 4 +- 68 files changed, 630 insertions(+), 357 deletions(-) create mode 100644 config/locales/forms/2023/lettings/soft_validations.en.yml create mode 100644 config/locales/forms/2024/lettings/soft_validations.en.yml create mode 100644 config/locales/forms/2025/lettings/soft_validations.en.yml diff --git a/app/helpers/interruption_screen_helper.rb b/app/helpers/interruption_screen_helper.rb index 7d9a38ddf..e4c09a050 100644 --- a/app/helpers/interruption_screen_helper.rb +++ b/app/helpers/interruption_screen_helper.rb @@ -1,7 +1,7 @@ module InterruptionScreenHelper def display_informative_text(informative_text, log) return informative_text if informative_text.is_a? String - return "" if informative_text.nil? + return "" if informative_text.blank? return "" unless informative_text["arguments"] translation_params = {} diff --git a/app/models/form/lettings/pages/care_home_charges_value_check.rb b/app/models/form/lettings/pages/care_home_charges_value_check.rb index 2cf253bf6..78e598e86 100644 --- a/app/models/form/lettings/pages/care_home_charges_value_check.rb +++ b/app/models/form/lettings/pages/care_home_charges_value_check.rb @@ -2,11 +2,15 @@ class Form::Lettings::Pages::CareHomeChargesValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "care_home_charges_value_check" + @copy_key = "lettings.soft_validations.care_home_charges_value_check" @depends_on = [{ "care_home_charge_expected_not_provided?" => true }] @title_text = { - "translation" => "soft_validations.care_home_charges.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + } + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } - @informative_text = "" end def questions diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb index d91794525..5b06d6a28 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadAgeValu def initialize(id, hsh, subsection) super(id, hsh, subsection) @id = "females_in_soft_age_range_in_pregnant_household_lead_age_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb index 6fc8bdd16..3e961b283 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadHhmembV def initialize(id, hsh, subsection) super(id, hsh, subsection) @id = "females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb index 9a2b707b3..af568b039 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdLeadValueCh def initialize(id, hsh, subsection) super @id = "females_in_soft_age_range_in_pregnant_household_lead_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb index 0b2e2451f..ddc8789f9 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeVa def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @id = "females_in_soft_age_range_in_pregnant_household_person_#{person_index}_age_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" @depends_on = [ { "female_in_pregnant_household_in_soft_validation_range?" => true, @@ -9,24 +10,12 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonAgeVa }, ] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } @person_index = person_index end diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb index c8d484bf4..099bea5d9 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb @@ -2,6 +2,8 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValue def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @id = "females_in_soft_age_range_in_pregnant_household_person_#{person_index}_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" + @depends_on = [ { "female_in_pregnant_household_in_soft_validation_range?" => true, @@ -9,24 +11,12 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPersonValue }, ] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } @person_index = person_index end diff --git a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb index c816fb0b2..3822ec940 100644 --- a/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb +++ b/app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdValueCheck def initialize(id, hsh, subsection) super @id = "females_in_soft_age_range_in_pregnant_household_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check" @depends_on = [{ "female_in_pregnant_household_in_soft_validation_range?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/lead_tenant_over_retirement_value_check.rb b/app/models/form/lettings/pages/lead_tenant_over_retirement_value_check.rb index b5add868b..43b00844c 100644 --- a/app/models/form/lettings/pages/lead_tenant_over_retirement_value_check.rb +++ b/app/models/form/lettings/pages/lead_tenant_over_retirement_value_check.rb @@ -2,11 +2,13 @@ class Form::Lettings::Pages::LeadTenantOverRetirementValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @depends_on = [{ "person_1_not_retired_over_soft_max_age?" => true }] + @copy_key = "lettings.soft_validations.retirement_value_check" @title_text = { - "translation" => "soft_validations.retirement.max.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", } @informative_text = { - "translation" => "soft_validations.retirement.max.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/lead_tenant_under_retirement_value_check.rb b/app/models/form/lettings/pages/lead_tenant_under_retirement_value_check.rb index 0c7a3ed2e..66a87c2bf 100644 --- a/app/models/form/lettings/pages/lead_tenant_under_retirement_value_check.rb +++ b/app/models/form/lettings/pages/lead_tenant_under_retirement_value_check.rb @@ -2,8 +2,9 @@ class Form::Lettings::Pages::LeadTenantUnderRetirementValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @depends_on = [{ "person_1_retired_under_soft_min_age?" => true }] + @copy_key = "lettings.soft_validations.no_retirement_value_check" @title_text = { - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "age1", @@ -12,7 +13,10 @@ class Form::Lettings::Pages::LeadTenantUnderRetirementValueCheck < ::Form::Page }, ], } - @informative_text = {} + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } end def questions diff --git a/app/models/form/lettings/pages/multiple_partners_value_check.rb b/app/models/form/lettings/pages/multiple_partners_value_check.rb index 3f9cdb3ae..4e9167a12 100644 --- a/app/models/form/lettings/pages/multiple_partners_value_check.rb +++ b/app/models/form/lettings/pages/multiple_partners_value_check.rb @@ -6,12 +6,16 @@ class Form::Lettings::Pages::MultiplePartnersValueCheck < Form::Page "multiple_partners?" => true, }, ] + @copy_key = "lettings.soft_validations.multiple_partners_value_check" @person_index = person_index @title_text = { - "translation" => "soft_validations.multiple_partners_lettings.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], + } + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } - @informative_text = {} end def questions diff --git a/app/models/form/lettings/pages/net_income_value_check.rb b/app/models/form/lettings/pages/net_income_value_check.rb index ccb2b2a08..9bdce131d 100644 --- a/app/models/form/lettings/pages/net_income_value_check.rb +++ b/app/models/form/lettings/pages/net_income_value_check.rb @@ -2,9 +2,10 @@ class Form::Lettings::Pages::NetIncomeValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "net_income_value_check" + @copy_key = "lettings.soft_validations.net_income_value_check" @depends_on = [{ "net_income_soft_validation_triggered?" => true }] @title_text = { - "translation" => "soft_validations.net_income.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "incfreq", @@ -20,7 +21,7 @@ class Form::Lettings::Pages::NetIncomeValueCheck < ::Form::Page } @informative_text = { - "translation" => "soft_validations.net_income.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [ { "key" => "net_income_higher_or_lower_text", diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_lead_age_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_lead_age_value_check.rb index 68b1c7f09..7e530a9ad 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_lead_age_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_lead_age_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadAgeValueCheck < ::For def initialize(id, hsh, subsection) super(id, hsh, subsection) @id = "no_females_pregnant_household_lead_age_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_lead_hhmemb_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_lead_hhmemb_value_check.rb index e1d1235ef..47ac7493b 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_lead_hhmemb_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_lead_hhmemb_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadHhmembValueCheck < :: def initialize(id, hsh, subsection) super @id = "no_females_pregnant_household_lead_hhmemb_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_lead_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_lead_value_check.rb index 416845735..edfe2c631 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_lead_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_lead_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdLeadValueCheck < ::Form:: def initialize(id, hsh, subsection) super @id = "no_females_pregnant_household_lead_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check.rb index 12db3a08e..5e808b853 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck < ::F def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @id = "no_females_pregnant_household_person_#{person_index}_age_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true, "age#{person_index}_known" => 0 }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } @person_index = person_index end diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_person_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_person_value_check.rb index f04333ec0..fb77eec18 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_person_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_person_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck < ::Form def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @id = "no_females_pregnant_household_person_#{person_index}_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true, "details_known_#{person_index}" => 0 }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } @person_index = person_index end diff --git a/app/models/form/lettings/pages/no_females_pregnant_household_value_check.rb b/app/models/form/lettings/pages/no_females_pregnant_household_value_check.rb index 9c84a953f..bce8a87ae 100644 --- a/app/models/form/lettings/pages/no_females_pregnant_household_value_check.rb +++ b/app/models/form/lettings/pages/no_females_pregnant_household_value_check.rb @@ -2,14 +2,15 @@ class Form::Lettings::Pages::NoFemalesPregnantHouseholdValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "no_females_pregnant_household_value_check" + @copy_key = "lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check" @depends_on = [{ "all_male_tenants_in_a_pregnant_household?" => true }] @title_text = { - "translation" => "soft_validations.pregnancy.title", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", + "arguments" => [], } @informative_text = { - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [{ "key" => "sex1", "label" => true, "i18n_template" => "sex1" }], + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } end diff --git a/app/models/form/lettings/pages/partner_under_16_value_check.rb b/app/models/form/lettings/pages/partner_under_16_value_check.rb index 87d5865c4..b33a827d4 100644 --- a/app/models/form/lettings/pages/partner_under_16_value_check.rb +++ b/app/models/form/lettings/pages/partner_under_16_value_check.rb @@ -6,9 +6,10 @@ class Form::Lettings::Pages::PartnerUnder16ValueCheck < Form::Page "person_#{person_index}_partner_under_16?" => true, }, ] + @copy_key = "lettings.soft_validations.partner_under_16_value_check" @person_index = person_index @title_text = { - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "age#{person_index}", @@ -17,7 +18,10 @@ class Form::Lettings::Pages::PartnerUnder16ValueCheck < Form::Page }, ], } - @informative_text = {} + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } end def questions diff --git a/app/models/form/lettings/pages/person_over_retirement_value_check.rb b/app/models/form/lettings/pages/person_over_retirement_value_check.rb index dbaf2d2e2..c094d4a93 100644 --- a/app/models/form/lettings/pages/person_over_retirement_value_check.rb +++ b/app/models/form/lettings/pages/person_over_retirement_value_check.rb @@ -2,11 +2,13 @@ class Form::Lettings::Pages::PersonOverRetirementValueCheck < ::Form::Page def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @depends_on = [{ "person_#{person_index}_not_retired_over_soft_max_age?" => true }] + @copy_key = "lettings.soft_validations.retirement_value_check" @title_text = { - "translation" => "soft_validations.retirement.max.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", } @informative_text = { - "translation" => "soft_validations.retirement.max.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], } @person_index = person_index end diff --git a/app/models/form/lettings/pages/person_under_retirement_value_check.rb b/app/models/form/lettings/pages/person_under_retirement_value_check.rb index ab9c81beb..853afafe0 100644 --- a/app/models/form/lettings/pages/person_under_retirement_value_check.rb +++ b/app/models/form/lettings/pages/person_under_retirement_value_check.rb @@ -2,8 +2,9 @@ class Form::Lettings::Pages::PersonUnderRetirementValueCheck < ::Form::Page def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @depends_on = [{ "person_#{person_index}_retired_under_soft_min_age?" => true }] + @copy_key = "lettings.soft_validations.no_retirement_value_check" @title_text = { - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "age#{person_index}", @@ -12,7 +13,10 @@ class Form::Lettings::Pages::PersonUnderRetirementValueCheck < ::Form::Page }, ], } - @informative_text = {} + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } @person_index = person_index end diff --git a/app/models/form/lettings/pages/property_major_repairs_value_check.rb b/app/models/form/lettings/pages/property_major_repairs_value_check.rb index 08672aff6..d1c7be34c 100644 --- a/app/models/form/lettings/pages/property_major_repairs_value_check.rb +++ b/app/models/form/lettings/pages/property_major_repairs_value_check.rb @@ -2,10 +2,11 @@ class Form::Lettings::Pages::PropertyMajorRepairsValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "property_major_repairs_value_check" + @copy_key = "lettings.soft_validations.major_repairs_date_value_check" @depends_on = [{ "major_repairs_date_in_soft_range?" => true }] - @title_text = { "translation" => "soft_validations.major_repairs_date.title_text" } + @title_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text" } @informative_text = { - "translation" => "soft_validations.major_repairs_date.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } end diff --git a/app/models/form/lettings/pages/pscharge_value_check.rb b/app/models/form/lettings/pages/pscharge_value_check.rb index 6c8ada196..8ff953afd 100644 --- a/app/models/form/lettings/pages/pscharge_value_check.rb +++ b/app/models/form/lettings/pages/pscharge_value_check.rb @@ -2,16 +2,20 @@ class Form::Lettings::Pages::PschargeValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "pscharge_value_check" + @copy_key = "lettings.soft_validations.pscharge_value_check" @depends_on = [{ "pscharge_in_soft_max_range?" => true }] @title_text = { - "translation" => "soft_validations.pscharge.over_soft_max_title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [{ "key" => "pscharge", "label" => true, "i18n_template" => "pscharge", }], } - @informative_text = I18n.t("soft_validations.charges.informative_text") + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } end def questions diff --git a/app/models/form/lettings/pages/reasonother_value_check.rb b/app/models/form/lettings/pages/reasonother_value_check.rb index ccda997a7..ccc6be70d 100644 --- a/app/models/form/lettings/pages/reasonother_value_check.rb +++ b/app/models/form/lettings/pages/reasonother_value_check.rb @@ -2,13 +2,14 @@ class Form::Lettings::Pages::ReasonotherValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "reasonother_value_check" + @copy_key = "lettings.soft_validations.reasonother_value_check" @depends_on = [{ "reasonother_might_be_existing_category?" => true }] @title_text = { - "translation" => "soft_validations.reasonother.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [{ "key" => "reasonother", "i18n_template" => "reasonother" }], } @informative_text = { - "translation" => "soft_validations.reasonother.informative_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } end diff --git a/app/models/form/lettings/pages/referral_value_check.rb b/app/models/form/lettings/pages/referral_value_check.rb index 55f6f3e8b..aa3a34200 100644 --- a/app/models/form/lettings/pages/referral_value_check.rb +++ b/app/models/form/lettings/pages/referral_value_check.rb @@ -2,12 +2,13 @@ class Form::Lettings::Pages::ReferralValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "referral_value_check" + @copy_key = "lettings.soft_validations.referral_value_check" @depends_on = [{ "la_referral_for_general_needs?" => true }] @title_text = { - "translation" => "soft_validations.referral.title_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", } @informative_text = { - "translation" => "soft_validations.referral.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } end diff --git a/app/models/form/lettings/pages/rent_value_check.rb b/app/models/form/lettings/pages/rent_value_check.rb index a80dc7339..5a1ecc847 100644 --- a/app/models/form/lettings/pages/rent_value_check.rb +++ b/app/models/form/lettings/pages/rent_value_check.rb @@ -2,8 +2,9 @@ class Form::Lettings::Pages::RentValueCheck < ::Form::Page def initialize(id, hsh, subsection, check_answers_card_number: nil) super(id, hsh, subsection) @depends_on = [{ "rent_soft_validation_triggered?" => true }] + @copy_key = "lettings.soft_validations.rent_value_check" @title_text = { - "translation" => "soft_validations.rent.outside_range_title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [ { "key" => "brent", @@ -13,7 +14,7 @@ class Form::Lettings::Pages::RentValueCheck < ::Form::Page ], } @informative_text = { - "translation" => "soft_validations.rent.informative_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [ { "key" => "rent_soft_validation_higher_or_lower_text", diff --git a/app/models/form/lettings/pages/scharge_value_check.rb b/app/models/form/lettings/pages/scharge_value_check.rb index 73ee41920..bd9accfc1 100644 --- a/app/models/form/lettings/pages/scharge_value_check.rb +++ b/app/models/form/lettings/pages/scharge_value_check.rb @@ -2,16 +2,20 @@ class Form::Lettings::Pages::SchargeValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "scharge_value_check" + @copy_key = "lettings.soft_validations.scharge_value_check" @depends_on = [{ "scharge_in_soft_max_range?" => true }] @title_text = { - "translation" => "soft_validations.scharge.over_soft_max_title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [{ "key" => "scharge", "label" => true, "i18n_template" => "scharge", }], } - @informative_text = I18n.t("soft_validations.charges.informative_text") + @title_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } end def questions diff --git a/app/models/form/lettings/pages/supcharg_value_check.rb b/app/models/form/lettings/pages/supcharg_value_check.rb index a974a8f89..89dcc89c1 100644 --- a/app/models/form/lettings/pages/supcharg_value_check.rb +++ b/app/models/form/lettings/pages/supcharg_value_check.rb @@ -2,16 +2,20 @@ class Form::Lettings::Pages::SupchargValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "supcharg_value_check" + @copy_key = "lettings.soft_validations.supcharg_value_check" @depends_on = [{ "supcharg_in_soft_max_range?" => true }] @title_text = { - "translation" => "soft_validations.supcharg.over_soft_max_title", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text", "arguments" => [{ "key" => "supcharg", "label" => true, "i18n_template" => "supcharg", }], } - @informative_text = I18n.t("soft_validations.charges.informative_text") + @informative_text = { + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", + "arguments" => [], + } end def questions diff --git a/app/models/form/lettings/pages/void_date_value_check.rb b/app/models/form/lettings/pages/void_date_value_check.rb index 6ebd3a175..b5d7fdadd 100644 --- a/app/models/form/lettings/pages/void_date_value_check.rb +++ b/app/models/form/lettings/pages/void_date_value_check.rb @@ -2,10 +2,11 @@ class Form::Lettings::Pages::VoidDateValueCheck < ::Form::Page def initialize(id, hsh, subsection) super @id = "void_date_value_check" + @copy_key = "lettings.soft_validations.void_date_value_check" @depends_on = [{ "voiddate_in_soft_range?" => true }] - @title_text = { "translation" => "soft_validations.void_date.title_text" } + @title_text = { "translation" => "forms.#{form.start_date.year}.#{@copy_key}.title_text" } @informative_text = { - "translation" => "soft_validations.void_date.hint_text", + "translation" => "forms.#{form.start_date.year}.#{@copy_key}.informative_text", "arguments" => [], } end diff --git a/app/models/form/lettings/questions/care_home_charges_value_check.rb b/app/models/form/lettings/questions/care_home_charges_value_check.rb index fdb5aabbd..a5f0d2522 100644 --- a/app/models/form/lettings/questions/care_home_charges_value_check.rb +++ b/app/models/form/lettings/questions/care_home_charges_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::CareHomeChargesValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "carehome_charges_value_check" - @check_answer_label = "Care home charges confirmation" - @header = "Are you sure there are no care home charges?" + @copy_key = "lettings.soft_validations.care_home_charges_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/major_repairs_date_value_check.rb b/app/models/form/lettings/questions/major_repairs_date_value_check.rb index d024f1a8d..0e9cb4171 100644 --- a/app/models/form/lettings/questions/major_repairs_date_value_check.rb +++ b/app/models/form/lettings/questions/major_repairs_date_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::MajorRepairsDateValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "major_repairs_date_value_check" - @check_answer_label = "Major repairs date confirmation" - @header = "Are you sure the property has been vacant for this long?" + @copy_key = "lettings.soft_validations.major_repairs_date_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/multiple_partners_value_check.rb b/app/models/form/lettings/questions/multiple_partners_value_check.rb index 65320ffdf..9dd9f7015 100644 --- a/app/models/form/lettings/questions/multiple_partners_value_check.rb +++ b/app/models/form/lettings/questions/multiple_partners_value_check.rb @@ -2,7 +2,7 @@ class Form::Lettings::Questions::MultiplePartnersValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "multiple_partners_value_check" - @check_answer_label = "Multiple partners confirmation" + @copy_key = "lettings.soft_validations.multiple_partners_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Lettings::Questions::MultiplePartnersValueCheck < ::Form::Question ], } @check_answers_card_number = person_index - @header = "Are you sure this is correct?" end end diff --git a/app/models/form/lettings/questions/net_income_value_check.rb b/app/models/form/lettings/questions/net_income_value_check.rb index 8267b3b22..4e85fee90 100644 --- a/app/models/form/lettings/questions/net_income_value_check.rb +++ b/app/models/form/lettings/questions/net_income_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::NetIncomeValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "net_income_value_check" - @check_answer_label = "Net income confirmation" - @header = "Are you sure this is correct?" + @copy_key = "lettings.soft_validations.net_income_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/no_retirement_value_check.rb b/app/models/form/lettings/questions/no_retirement_value_check.rb index 0e2033c61..82784dec8 100644 --- a/app/models/form/lettings/questions/no_retirement_value_check.rb +++ b/app/models/form/lettings/questions/no_retirement_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::NoRetirementValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "retirement_value_check" - @check_answer_label = "Retirement confirmation" - @header = "Are you sure this person is retired?" + @copy_key = "lettings.soft_validations.no_retirement_value_check" @type = "interruption_screen" @check_answers_card_number = person_index @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/partner_under_16_value_check.rb b/app/models/form/lettings/questions/partner_under_16_value_check.rb index 7cda45cb5..bc11aec47 100644 --- a/app/models/form/lettings/questions/partner_under_16_value_check.rb +++ b/app/models/form/lettings/questions/partner_under_16_value_check.rb @@ -2,7 +2,7 @@ class Form::Lettings::Questions::PartnerUnder16ValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "partner_under_16_value_check" - @check_answer_label = "Partner under 16 confirmation" + @copy_key = "lettings.soft_validations.partner_under_16_value_check" @type = "interruption_screen" @answer_options = { "0" => { "value" => "Yes" }, @@ -19,6 +19,5 @@ class Form::Lettings::Questions::PartnerUnder16ValueCheck < ::Form::Question ], } @check_answers_card_number = person_index - @header = "Are you sure this is correct?" end end diff --git a/app/models/form/lettings/questions/pregnancy_value_check.rb b/app/models/form/lettings/questions/pregnancy_value_check.rb index 9ef1778c2..0ddddecec 100644 --- a/app/models/form/lettings/questions/pregnancy_value_check.rb +++ b/app/models/form/lettings/questions/pregnancy_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::PregnancyValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "pregnancy_value_check" - @check_answer_label = "Pregnancy confirmation" - @header = "Are you sure this is correct?" + @copy_key = page.copy_key @type = "interruption_screen" @check_answers_card_number = person_index @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/pscharge_value_check.rb b/app/models/form/lettings/questions/pscharge_value_check.rb index b44979ae1..efb94fb53 100644 --- a/app/models/form/lettings/questions/pscharge_value_check.rb +++ b/app/models/form/lettings/questions/pscharge_value_check.rb @@ -2,13 +2,11 @@ class Form::Lettings::Questions::PschargeValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "pscharge_value_check" - @check_answer_label = "Personal service charge confirmation" - @header = "Are you sure?" + @copy_key = "lettings.soft_validations.pscharge_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "pscharge_value_check" => 0 }, { "pscharge_value_check" => 1 }] } - @hint_text = I18n.t("soft_validations.charges.hint_text") end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/questions/reasonother_value_check.rb b/app/models/form/lettings/questions/reasonother_value_check.rb index 865f38764..9fb5618fc 100644 --- a/app/models/form/lettings/questions/reasonother_value_check.rb +++ b/app/models/form/lettings/questions/reasonother_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::ReasonotherValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "reasonother_value_check" - @check_answer_label = "Reason other confirmation" - @header = "Are you sure this doesn’t fit an existing category?" + @copy_key = "lettings.soft_validations.reasonother_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/referral_value_check.rb b/app/models/form/lettings/questions/referral_value_check.rb index 30aa45f4c..04dfadd9e 100644 --- a/app/models/form/lettings/questions/referral_value_check.rb +++ b/app/models/form/lettings/questions/referral_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::ReferralValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "referral_value_check" - @check_answer_label = "Referral confirmation" - @header = "Are you sure?" + @copy_key = "lettings.soft_validations.referral_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/rent_value_check.rb b/app/models/form/lettings/questions/rent_value_check.rb index 688499259..fb7ac8d16 100644 --- a/app/models/form/lettings/questions/rent_value_check.rb +++ b/app/models/form/lettings/questions/rent_value_check.rb @@ -2,10 +2,8 @@ class Form::Lettings::Questions::RentValueCheck < ::Form::Question def initialize(id, hsh, page, check_answers_card_number:) super(id, hsh, page) @id = "rent_value_check" - @check_answer_label = "Total rent confirmation" - @header = "Are you sure this is correct?" + @copy_key = "lettings.soft_validations.rent_value_check" @type = "interruption_screen" - @hint_text = I18n.t("soft_validations.rent.hint_text") @check_answers_card_number = check_answers_card_number @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] } diff --git a/app/models/form/lettings/questions/retirement_value_check.rb b/app/models/form/lettings/questions/retirement_value_check.rb index 63a286d61..23d077fbf 100644 --- a/app/models/form/lettings/questions/retirement_value_check.rb +++ b/app/models/form/lettings/questions/retirement_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::RetirementValueCheck < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "retirement_value_check" - @check_answer_label = "Retirement confirmation" - @header = "Are you sure this person isn’t retired?" + @copy_key = "lettings.soft_validations.retirement_value_check" @type = "interruption_screen" @check_answers_card_number = person_index @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/scharge_value_check.rb b/app/models/form/lettings/questions/scharge_value_check.rb index 1946d603f..0f761b7aa 100644 --- a/app/models/form/lettings/questions/scharge_value_check.rb +++ b/app/models/form/lettings/questions/scharge_value_check.rb @@ -2,13 +2,11 @@ class Form::Lettings::Questions::SchargeValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "scharge_value_check" - @check_answer_label = "Service charge confirmation" - @header = "Are you sure?" + @copy_key = "lettings.soft_validations.scharge_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "scharge_value_check" => 0 }, { "scharge_value_check" => 1 }] } - @hint_text = I18n.t("soft_validations.charges.hint_text") end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/questions/supcharg_value_check.rb b/app/models/form/lettings/questions/supcharg_value_check.rb index 978c5e3ef..10fd6562c 100644 --- a/app/models/form/lettings/questions/supcharg_value_check.rb +++ b/app/models/form/lettings/questions/supcharg_value_check.rb @@ -2,13 +2,11 @@ class Form::Lettings::Questions::SupchargValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "supcharg_value_check" - @check_answer_label = "Support charge confirmation" - @header = "Are you sure?" + @copy_key = "lettings.soft_validations.supcharg_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "supcharg_value_check" => 0 }, { "supcharg_value_check" => 1 }] } - @hint_text = I18n.t("soft_validations.charges.hint_text") end ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze diff --git a/app/models/form/lettings/questions/void_date_value_check.rb b/app/models/form/lettings/questions/void_date_value_check.rb index 22446061f..faf507a1b 100644 --- a/app/models/form/lettings/questions/void_date_value_check.rb +++ b/app/models/form/lettings/questions/void_date_value_check.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::VoidDateValueCheck < ::Form::Question def initialize(id, hsh, page) super @id = "void_date_value_check" - @check_answer_label = "Void date confirmation" - @header = "Are you sure the property has been vacant for this long?" + @copy_key = "lettings.soft_validations.void_date_value_check" @type = "interruption_screen" @check_answers_card_number = 0 @answer_options = ANSWER_OPTIONS diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index 6ebc090b6..ac615b0e2 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -7411,10 +7411,10 @@ } ], "title_text": { - "translation": "soft_validations.net_income.title_text" + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.title_text" }, "informative_text": { - "translation": "soft_validations.net_income.hint_text", + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.informative_text", "arguments": [ { "key": "ecstat1", diff --git a/config/forms/2022_2023.json b/config/forms/2022_2023.json index 54cd67fd4..7d6f44b20 100644 --- a/config/forms/2022_2023.json +++ b/config/forms/2022_2023.json @@ -7870,7 +7870,7 @@ } ], "title_text": { - "translation": "soft_validations.net_income.title_text", + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.title_text", "arguments": [ { "key": "incfreq", @@ -7885,7 +7885,7 @@ ] }, "informative_text": { - "translation": "soft_validations.net_income.hint_text", + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.informative_text", "arguments": [ { "key": "net_income_higher_or_lower_text", diff --git a/config/locales/en.yml b/config/locales/en.yml index 81c94b8c4..55044b7a6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -553,17 +553,6 @@ en: organisation_not_selected: "Select an organisation from the search list." soft_validations: - net_income: - title_text: "You told us that the household’s income is %{earnings} %{incfreq}." - hint_text: "This is %{net_income_higher_or_lower_text} than we would expect for the household’s working situation." - in_soft_min_range: - message: "Net income is lower than expected based on the household’s working situation. Are you sure this is correct?" - in_soft_max_range: - message: "Net income is higher than expected based on the household’s working situation. Are you sure this is correct?" - rent: - outside_range_title: "You told us the rent is %{brent}." - informative_text: "This is %{higher_or_lower} than we would expect." - hint_text: "Check the following:" retirement: min: title: "You told us this person is aged %{age} years and retired." @@ -571,40 +560,6 @@ en: max: title: "You told us this person is over 66 and not retired." hint_text: "The minimum expected retirement age in England is 66." - pregnancy: - title: "You told us somebody in the household is pregnant." - all_male_tenants: "You also told us that all the tenants living at the property are male." - females_not_in_soft_age_range: "You also told us that any female tenants living at the property are in the following age ranges:" - major_repairs_date: - title_text: "You told us the property has been vacant for 2 years." - hint_text: "This is higher than we would expect." - void_date: - title_text: "You told us that the property has been vacant for more than 2 years." - hint_text: "This is higher than we would expect." - referral: - title_text: "Are you sure?" - hint_text: "This is a general needs log, and this referral type is for supported housing." - scharge: - over_soft_max_title: "You told us the service charge is %{scharge}." - pscharge: - over_soft_max_title: "You told us the personal service charge is %{pscharge}." - supcharg: - over_soft_max_title: "You told us the support charge is %{supcharg}." - charges: - informative_text: "This is higher than we would expect." - hint_text: "Check the following:" - reasonother: - title_text: "You told us that the tenant’s main reason for leaving their last settled home was %{reasonother}." - informative_text: "The reason you have entered looks very similar to one of the existing response categories. - Please check the categories and select the appropriate one. - If the existing categories are not suitable, please confirm here to move onto the next question." - saledate: - must_be_less_than_3_years_from_hodate: "You told us sale completion date is more than 3 years after practical completion or handover date." - partner_under_16_lettings: - title: "You told us this person is aged %{age} years and has 'Partner' relationship to the lead tenant." - multiple_partners_lettings: - title: "You told us there are more than 1 persons with 'Partner' relationship to the lead tenant." - devise: two_factor_authentication: success: "Two-factor authentication successful." diff --git a/config/locales/forms/2023/lettings/soft_validations.en.yml b/config/locales/forms/2023/lettings/soft_validations.en.yml new file mode 100644 index 000000000..d0354f127 --- /dev/null +++ b/config/locales/forms/2023/lettings/soft_validations.en.yml @@ -0,0 +1,132 @@ +en: + forms: + 2023: + lettings: + soft_validations: + pregnancy_value_check: + no_females_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that all the tenants living at the property are male." + females_in_soft_age_range_in_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that any female tenants living at the property are in the following age ranges:" + + no_retirement_value_check: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + question_text: "Are you sure this person is retired?" + title_text: "You told us this person is aged %{age} years and retired." + informative_text: "The minimum expected retirement age in England is 66." + + retirement_value_check: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + question_text: "Are you sure this person isn’t retired?" + title_text: "You told us this person is over 66 and not retired." + informative_text: "" + + partner_under_16_value_check: + page_header: "" + check_answer_label: "Partner under 16 confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us this person is aged %{age} years and has 'Partner' relationship to the lead tenant." + informative_text: "Are you sure this is correct?" + + multiple_partners_value_check: + page_header: "" + check_answer_label: "Multiple partners confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us there are more than 1 persons with 'Partner' relationship to the lead tenant." + informative_text: "Are you sure this is correct?" + + reasonother_value_check: + page_header: "" + check_answer_label: "Reason other confirmation" + hint_text: "" + question_text: "Are you sure this doesn’t fit an existing category?" + title_text: "You told us that the tenant’s main reason for leaving their last settled home was %{reasonother}." + informative_text: "The reason you have entered looks very similar to one of the existing response categories. Please check the categories and select the appropriate one. If the existing categories are not suitable, please confirm here to move onto the next question." + + referral_value_check: + page_header: "" + check_answer_label: "Referral confirmation" + hint_text: "" + question_text: "Are you sure?" + title_text: "Are you sure?" + informative_text: "This is a general needs log, and this referral type is for supported housing." + + net_income_value_check: + page_header: "" + check_answer_label: "Net income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that the household’s income is %{earnings} %{incfreq}." + informative_text: "This is %{net_income_higher_or_lower_text} than we would expect for the household’s working situation." + + care_home_charges_value_check: + page_header: "" + check_answer_label: "Care home charges confirmation" + hint_text: "" + question_text: "Are you sure there are no care home charges?" + title_text: "Care home charges should be provided if this is a care home accommodation." + informative_text: "Are you sure there are no care home charges?" + + rent_value_check: + page_header: "" + check_answer_label: "Total rent confirmation" + hint_text: "Check the following:" + question_text: "Are you sure this is correct?" + title_text: "You told us the rent is %{brent}." + informative_text: "This is %{higher_or_lower} than we would expect." + + scharge_value_check: + page_header: "" + check_answer_label: "Service charge confirmation" + hint_text: "Check the following:" + question_text: "Are you sure?" + title_text: "You told us the service charge is %{scharge}." + informative_text: "This is higher than we would expect." + + pscharge_value_check: + page_header: "" + check_answer_label: "Personal service charge confirmation" + hint_text: "Check the following:" + question_text: "Are you sure?" + title_text: "You told us the personal service charge is %{pscharge}." + informative_text: "This is higher than we would expect." + + supcharg_value_check: + page_header: "" + check_answer_label: "Support charge confirmation" + hint_text: "Check the following:" + question_text: "Are you sure?" + title_text: "You told us the support charge is %{supcharg}." + informative_text: "This is higher than we would expect." + + void_date_value_check: + page_header: "" + check_answer_label: "Void date confirmation" + hint_text: "" + question_text: "Are you sure the property has been vacant for this long?" + title_text: "You told us that the property has been vacant for more than 2 years." + informative_text: "This is higher than we would expect." + + major_repairs_date_value_check: + page_header: "" + check_answer_label: "Major repairs date confirmation" + hint_text: "" + 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 higher than we would expect." diff --git a/config/locales/forms/2024/lettings/soft_validations.en.yml b/config/locales/forms/2024/lettings/soft_validations.en.yml new file mode 100644 index 000000000..ada093d39 --- /dev/null +++ b/config/locales/forms/2024/lettings/soft_validations.en.yml @@ -0,0 +1,132 @@ +en: + forms: + 2024: + lettings: + soft_validations: + pregnancy_value_check: + no_females_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that all the tenants living at the property are male." + females_in_soft_age_range_in_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that any female tenants living at the property are in the following age ranges:" + + no_retirement_value_check: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + question_text: "Are you sure this person is retired?" + title_text: "You told us this person is aged %{age} years and retired." + informative_text: "The minimum expected retirement age in England is 66." + + retirement_value_check: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + question_text: "Are you sure this person isn’t retired?" + title_text: "You told us this person is over 66 and not retired." + informative_text: "Are you sure this person isn’t retired?" + + partner_under_16_value_check: + page_header: "" + check_answer_label: "Partner under 16 confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us this person is aged %{age} years and has 'Partner' relationship to the lead tenant." + informative_text: "Are you sure this is correct?" + + multiple_partners_value_check: + page_header: "" + check_answer_label: "Multiple partners confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us there are more than 1 persons with 'Partner' relationship to the lead tenant." + informative_text: "Are you sure this is correct?" + + reasonother_value_check: + page_header: "" + check_answer_label: "Reason other confirmation" + hint_text: "" + question_text: "Are you sure this doesn’t fit an existing category?" + title_text: "You told us that the tenant’s main reason for leaving their last settled home was %{reasonother}." + informative_text: "The reason you have entered looks very similar to one of the existing response categories. Please check the categories and select the appropriate one. If the existing categories are not suitable, please confirm here to move onto the next question." + + referral_value_check: + page_header: "" + check_answer_label: "Referral confirmation" + hint_text: "" + question_text: "Are you sure?" + title_text: "Are you sure?" + informative_text: "This is a general needs log, and this referral type is for supported housing." + + net_income_value_check: + page_header: "" + check_answer_label: "Net income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that the household’s income is %{earnings} %{incfreq}." + informative_text: "This is %{net_income_higher_or_lower_text} than we would expect for the household’s working situation." + + care_home_charges_value_check: + page_header: "" + check_answer_label: "Care home charges confirmation" + hint_text: "" + question_text: "Are you sure there are no care home charges?" + title_text: "Care home charges should be provided if this is a care home accommodation." + informative_text: "Are you sure there are no care home charges?" + + rent_value_check: + page_header: "" + check_answer_label: "Total rent confirmation" + hint_text: "Check the following:" + question_text: "Are you sure this is correct?" + title_text: "You told us the rent is %{brent}." + informative_text: "This is %{higher_or_lower} than we would expect." + + scharge_value_check: + page_header: "" + check_answer_label: "Service charge confirmation" + hint_text: "Check the following:" + question_text: "Are you sure?" + title_text: "You told us the service charge is %{scharge}." + informative_text: "This is higher than we would expect." + + pscharge_value_check: + page_header: "" + check_answer_label: "Personal service charge confirmation" + hint_text: "Check the following:" + question_text: "Are you sure?" + title_text: "You told us the personal service charge is %{pscharge}." + informative_text: "This is higher than we would expect." + + supcharg_value_check: + page_header: "" + check_answer_label: "Support charge confirmation" + hint_text: "Check the following:" + question_text: "Are you sure?" + title_text: "You told us the support charge is %{supcharg}." + informative_text: "This is higher than we would expect." + + void_date_value_check: + page_header: "" + check_answer_label: "Void date confirmation" + hint_text: "" + question_text: "Are you sure the property has been vacant for this long?" + title_text: "You told us that the property has been vacant for more than 2 years." + informative_text: "This is longer than we would expect." + + major_repairs_date_value_check: + page_header: "" + check_answer_label: "Major repairs date confirmation" + hint_text: "" + 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." diff --git a/config/locales/forms/2025/lettings/soft_validations.en.yml b/config/locales/forms/2025/lettings/soft_validations.en.yml new file mode 100644 index 000000000..03a3cbb3d --- /dev/null +++ b/config/locales/forms/2025/lettings/soft_validations.en.yml @@ -0,0 +1,132 @@ +en: + forms: + 2025: + lettings: + soft_validations: + pregnancy_value_check: + no_females_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that all the tenants living at the property are male." + females_in_soft_age_range_in_pregnant_household_value_check: + page_header: "" + check_answer_label: "Pregnancy confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us somebody in the household is pregnant." + informative_text: "You also told us that any female tenants living at the property are in the following age ranges:" + + no_retirement_value_check: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + question_text: "Are you sure this person is retired?" + title_text: "You told us this person is aged %{age} years and retired." + informative_text: "The minimum expected retirement age in England is 66." + + retirement_value_check: + page_header: "" + check_answer_label: "Retirement confirmation" + hint_text: "" + question_text: "Are you sure this person isn’t retired?" + title_text: "You told us this person is over 66 and not retired." + informative_text: "Are you sure this person isn’t retired?" + + partner_under_16_value_check: + page_header: "" + check_answer_label: "Partner under 16 confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us this person is aged %{age} years and has 'Partner' relationship to the lead tenant." + informative_text: "Are you sure this is correct?" + + multiple_partners_value_check: + page_header: "" + check_answer_label: "Multiple partners confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us there are more than 1 persons with 'Partner' relationship to the lead tenant." + informative_text: "Are you sure this is correct?" + + reasonother_value_check: + page_header: "" + check_answer_label: "Reason other confirmation" + hint_text: "" + question_text: "Are you sure this doesn’t fit an existing category?" + title_text: "You told us that the tenant’s main reason for leaving their last settled home was %{reasonother}." + informative_text: "The reason you have entered looks very similar to one of the existing response categories. Please check the categories and select the appropriate one. If the existing categories are not suitable, please confirm here to move onto the next question." + + referral_value_check: + page_header: "" + check_answer_label: "Referral confirmation" + hint_text: "" + question_text: "Are you sure?" + title_text: "Are you sure?" + informative_text: "This is a general needs log, and this referral type is for supported housing." + + net_income_value_check: + page_header: "" + check_answer_label: "Net income confirmation" + hint_text: "" + question_text: "Are you sure this is correct?" + title_text: "You told us that the household’s income is %{earnings} %{incfreq}." + informative_text: "This is %{net_income_higher_or_lower_text} than we would expect for the household’s working situation." + + care_home_charges_value_check: + page_header: "" + check_answer_label: "Care home charges confirmation" + hint_text: "" + question_text: "Are you sure there are no care home charges?" + title_text: "Care home charges should be provided if this is a care home accommodation." + informative_text: "Are you sure there are no care home charges?" + + rent_value_check: + page_header: "" + check_answer_label: "Total rent confirmation" + hint_text: "Check the following:" + question_text: "Are you sure this is correct?" + title_text: "You told us the rent is %{brent}." + informative_text: "This is %{higher_or_lower} than we would expect." + + scharge_value_check: + page_header: "" + check_answer_label: "Service charge confirmation" + hint_text: "Check the following:" + question_text: "Are you sure?" + title_text: "You told us the service charge is %{scharge}." + informative_text: "This is higher than we would expect." + + pscharge_value_check: + page_header: "" + check_answer_label: "Personal service charge confirmation" + hint_text: "Check the following:" + question_text: "Are you sure?" + title_text: "You told us the personal service charge is %{pscharge}." + informative_text: "This is higher than we would expect." + + supcharg_value_check: + page_header: "" + check_answer_label: "Support charge confirmation" + hint_text: "Check the following:" + question_text: "Are you sure?" + title_text: "You told us the support charge is %{supcharg}." + informative_text: "This is higher than we would expect." + + void_date_value_check: + page_header: "" + check_answer_label: "Void date confirmation" + hint_text: "" + question_text: "Are you sure the property has been vacant for this long?" + title_text: "You told us that the property has been vacant for more than 2 years." + informative_text: "This is longer than we would expect." + + major_repairs_date_value_check: + page_header: "" + check_answer_label: "Major repairs date confirmation" + hint_text: "" + 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." diff --git a/spec/fixtures/forms/2021_2022.json b/spec/fixtures/forms/2021_2022.json index 3159459ad..cb0aaf06e 100644 --- a/spec/fixtures/forms/2021_2022.json +++ b/spec/fixtures/forms/2021_2022.json @@ -740,7 +740,7 @@ } ], "title_text": { - "translation": "soft_validations.net_income.title_text", + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.title_text", "arguments": [ { "key": "incfreq", @@ -755,7 +755,7 @@ ] }, "informative_text": { - "translation": "soft_validations.net_income.hint_text", + "translation": "forms.2024.lettings.soft_validations.net_income_value_check.informative_text", "arguments": [ { "key": "net_income_higher_or_lower_text", diff --git a/spec/helpers/interruption_screen_helper_spec.rb b/spec/helpers/interruption_screen_helper_spec.rb index 60cd71131..0d4456f2a 100644 --- a/spec/helpers/interruption_screen_helper_spec.rb +++ b/spec/helpers/interruption_screen_helper_spec.rb @@ -93,7 +93,7 @@ RSpec.describe InterruptionScreenHelper do context "when 1 out of 2 arguments are given" do it "returns an empty string" do informative_text = { - "translation" => "soft_validations.net_income.hint_text", + "translation" => "forms.2024.lettings.soft_validations.net_income_value_check.informative_text", "arguments" => [ { "key" => "ecstat1", diff --git a/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb b/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb index 0530cf445..e9c1d5879 100644 --- a/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb +++ b/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb @@ -30,12 +30,12 @@ RSpec.describe Form::Lettings::Pages::CareHomeChargesValueCheck, type: :model do it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.care_home_charges.title_text", + "translation" => "forms.2024.lettings.soft_validations.care_home_charges_value_check.title_text", }) end it "has the correct informative_text" do - expect(page.informative_text).to eq("") + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.care_home_charges_value_check.informative_text" }) end it "has the correct interruption_screen_question_ids" do diff --git a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb index 0b3d770b3..865fc6fd2 100644 --- a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb +++ b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb @@ -37,27 +37,15 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end @@ -82,27 +70,15 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end diff --git a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb index f380a5cb9..8ce2e5451 100644 --- a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb +++ b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb @@ -37,27 +37,15 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end @@ -82,27 +70,15 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end diff --git a/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb b/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb index 551a3b070..f116cb601 100644 --- a/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb +++ b/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb @@ -4,7 +4,8 @@ RSpec.describe Form::Lettings::Pages::MultiplePartnersValueCheck, type: :model d subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } 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(:person_index) { 1 } let(:page_id) { "multiple_partners_value_check" } @@ -39,13 +40,13 @@ RSpec.describe Form::Lettings::Pages::MultiplePartnersValueCheck, type: :model d it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.multiple_partners_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.multiple_partners_value_check.title_text", "arguments" => [], }) end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.multiple_partners_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -71,13 +72,13 @@ RSpec.describe Form::Lettings::Pages::MultiplePartnersValueCheck, type: :model d it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.multiple_partners_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.multiple_partners_value_check.title_text", "arguments" => [], }) end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.multiple_partners_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do diff --git a/spec/models/form/lettings/pages/net_income_value_check_spec.rb b/spec/models/form/lettings/pages/net_income_value_check_spec.rb index 523e02c8b..fe98919ae 100644 --- a/spec/models/form/lettings/pages/net_income_value_check_spec.rb +++ b/spec/models/form/lettings/pages/net_income_value_check_spec.rb @@ -24,13 +24,13 @@ RSpec.describe Form::Lettings::Pages::NetIncomeValueCheck, type: :model do end it "has the correct title_text" do - expect(page.title_text).to eq({ "translation" => "soft_validations.net_income.title_text", "arguments" => [{ "i18n_template" => "incfreq", "key" => "incfreq", "label" => true }, { "arguments_for_key" => "earnings", "i18n_template" => "earnings", "key" => "field_formatted_as_currency" }] }) + expect(page.title_text).to eq({ "translation" => "forms.2024.lettings.soft_validations.net_income_value_check.title_text", "arguments" => [{ "i18n_template" => "incfreq", "key" => "incfreq", "label" => true }, { "arguments_for_key" => "earnings", "i18n_template" => "earnings", "key" => "field_formatted_as_currency" }] }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ "arguments" => [{ "i18n_template" => "net_income_higher_or_lower_text", "key" => "net_income_higher_or_lower_text", "label" => false }], - "translation" => "soft_validations.net_income.hint_text", + "translation" => "forms.2024.lettings.soft_validations.net_income_value_check.informative_text", }) end end diff --git a/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb b/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb index 286ac6183..6cf6302f8 100644 --- a/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb +++ b/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb @@ -37,27 +37,15 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCh it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end @@ -82,27 +70,15 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCh it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end diff --git a/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb b/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb index 205f19ae1..f986f17d2 100644 --- a/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb +++ b/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb @@ -37,27 +37,15 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end @@ -82,27 +70,15 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.pregnancy.title", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.title_text", + "arguments" => [], }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.pregnancy.all_male_tenants", - "arguments" => [ - { - "key" => "sex1", - "label" => true, - "i18n_template" => "sex1", - }, - ], + "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.informative_text", + "arguments" => [], }) end end diff --git a/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb b/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb index a769f95cc..168f4ca91 100644 --- a/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb +++ b/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb @@ -4,7 +4,8 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) } 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(:person_index) { 1 } let(:page_id) { "partner_under_16_value_check" } @@ -39,7 +40,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age1", @@ -51,7 +52,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -77,7 +78,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age2", @@ -89,7 +90,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -115,7 +116,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age3", @@ -127,7 +128,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -153,7 +154,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age4", @@ -165,7 +166,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -191,7 +192,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age5", @@ -203,7 +204,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do @@ -229,7 +230,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do it "has correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.partner_under_16_lettings.title", + "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.title_text", "arguments" => [ { "key" => "age6", @@ -241,7 +242,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do end it "has correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.partner_under_16_value_check.informative_text" }) end it "has correct interruption_screen_question_ids" do diff --git a/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb b/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb index ec00f0d75..c8a482ee4 100644 --- a/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb +++ b/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb @@ -28,13 +28,14 @@ RSpec.describe Form::Lettings::Pages::PersonOverRetirementValueCheck, type: :mod it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.max.title", + "translation" => "forms.2024.lettings.soft_validations.retirement_value_check.title_text", }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.retirement.max.hint_text", + "translation" => "forms.2024.lettings.soft_validations.retirement_value_check.informative_text", + "arguments" => [], }) end end @@ -50,13 +51,14 @@ RSpec.describe Form::Lettings::Pages::PersonOverRetirementValueCheck, type: :mod it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.max.title", + "translation" => "forms.2024.lettings.soft_validations.retirement_value_check.title_text", }) end it "has the correct informative_text" do expect(page.informative_text).to eq({ - "translation" => "soft_validations.retirement.max.hint_text", + "translation" => "forms.2024.lettings.soft_validations.retirement_value_check.informative_text", + "arguments" => [], }) end end diff --git a/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb b/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb index 37ca94f9e..6226e0309 100644 --- a/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb +++ b/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb @@ -28,7 +28,7 @@ RSpec.describe Form::Lettings::Pages::PersonUnderRetirementValueCheck, type: :mo it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.lettings.soft_validations.no_retirement_value_check.title_text", "arguments" => [ { "key" => "age2", @@ -40,7 +40,7 @@ RSpec.describe Form::Lettings::Pages::PersonUnderRetirementValueCheck, type: :mo end it "has the correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.no_retirement_value_check.informative_text" }) end end @@ -55,7 +55,7 @@ RSpec.describe Form::Lettings::Pages::PersonUnderRetirementValueCheck, type: :mo it "has the correct title_text" do expect(page.title_text).to eq({ - "translation" => "soft_validations.retirement.min.title", + "translation" => "forms.2024.lettings.soft_validations.no_retirement_value_check.title_text", "arguments" => [ { "key" => "age3", @@ -67,7 +67,7 @@ RSpec.describe Form::Lettings::Pages::PersonUnderRetirementValueCheck, type: :mo end it "has the correct informative_text" do - expect(page.informative_text).to eq({}) + expect(page.informative_text).to eq({ "arguments" => [], "translation" => "forms.2024.lettings.soft_validations.no_retirement_value_check.informative_text" }) end end end diff --git a/spec/models/form/lettings/subsections/household_characteristics_spec.rb b/spec/models/form/lettings/subsections/household_characteristics_spec.rb index b97717077..b45f86fce 100644 --- a/spec/models/form/lettings/subsections/household_characteristics_spec.rb +++ b/spec/models/form/lettings/subsections/household_characteristics_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod let(:subsection_id) { nil } let(:subsection_definition) { nil } let(:section) { instance_double(Form::Lettings::Sections::Household) } - let(:form) { instance_double(Form) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do allow(section).to receive(:form).and_return(form) diff --git a/spec/models/form/lettings/subsections/household_needs_spec.rb b/spec/models/form/lettings/subsections/household_needs_spec.rb index 6e4dd25f1..dcd957601 100644 --- a/spec/models/form/lettings/subsections/household_needs_spec.rb +++ b/spec/models/form/lettings/subsections/household_needs_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Lettings::Subsections::HouseholdNeeds, type: :model do let(:subsection_id) { nil } let(:subsection_definition) { nil } - let(:section) { instance_double(Form::Lettings::Sections::Household) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:section) { instance_double(Form::Lettings::Sections::Household, form:) } it "has correct section" do expect(household_needs.section).to eq(section) diff --git a/spec/models/form/lettings/subsections/household_situation_spec.rb b/spec/models/form/lettings/subsections/household_situation_spec.rb index b9f65dbdd..d672b3ccc 100644 --- a/spec/models/form/lettings/subsections/household_situation_spec.rb +++ b/spec/models/form/lettings/subsections/household_situation_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdSituation, type: :model do let(:subsection_id) { nil } let(:subsection_definition) { nil } let(:section) { instance_double(Form::Lettings::Sections::Household) } - let(:form) { instance_double(Form) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } before do allow(section).to receive(:form).and_return(form) diff --git a/spec/models/form/lettings/subsections/income_and_benefits_spec.rb b/spec/models/form/lettings/subsections/income_and_benefits_spec.rb index 4c92faaf6..7bdc26bfa 100644 --- a/spec/models/form/lettings/subsections/income_and_benefits_spec.rb +++ b/spec/models/form/lettings/subsections/income_and_benefits_spec.rb @@ -5,7 +5,8 @@ RSpec.describe Form::Lettings::Subsections::IncomeAndBenefits, type: :model do let(:subsection_id) { nil } let(:subsection_definition) { nil } - let(:section) { instance_double(Form::Lettings::Sections::RentAndCharges) } + let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) } + let(:section) { instance_double(Form::Lettings::Sections::RentAndCharges, form:) } it "has correct section" do expect(income_and_benefits.section).to eq(section) diff --git a/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb b/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb index 8161f8a00..591ffdd53 100644 --- a/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb @@ -1851,8 +1851,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do it "populates with correct error message" do parser.valid? - expect(parser.errors.where(:field_46, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") - expect(parser.errors.where(:field_50, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") + expect(parser.errors.where(:field_46, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.") + expect(parser.errors.where(:field_50, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.") end end diff --git a/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb b/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb index e33458eb4..e9047b2ae 100644 --- a/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb @@ -1881,8 +1881,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "populates with correct error message" do parser.valid? - expect(parser.errors.where(:field_42, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") - expect(parser.errors.where(:field_46, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired.") + expect(parser.errors.where(:field_42, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.") + expect(parser.errors.where(:field_46, category: :soft_validation).first.message).to eql("You told us this person is aged 22 years and retired. The minimum expected retirement age in England is 66.") end end