From 3a0329f3e84d944e2191d52fae5ff6ced08bbf7d Mon Sep 17 00:00:00 2001
From: Kat <54268893+kosiakkatrina@users.noreply.github.com>
Date: Tue, 29 Oct 2024 12:04:06 +0000
Subject: [PATCH] Update tests and 2024 soft validations
---
.../subsections/income_and_benefits.rb | 8 +-
.../2024/lettings/soft_validations.en.yml | 131 ++++++++++++++++++
.../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 +-
16 files changed, 207 insertions(+), 166 deletions(-)
create mode 100644 config/locales/forms/2024/lettings/soft_validations.en.yml
diff --git a/app/models/form/lettings/subsections/income_and_benefits.rb b/app/models/form/lettings/subsections/income_and_benefits.rb
index ccdf68c37..2be2fb9a5 100644
--- a/app/models/form/lettings/subsections/income_and_benefits.rb
+++ b/app/models/form/lettings/subsections/income_and_benefits.rb
@@ -10,7 +10,7 @@ class Form::Lettings::Subsections::IncomeAndBenefits < ::Form::Subsection
@pages ||= [
Form::Lettings::Pages::IncomeKnown.new(nil, nil, self),
Form::Lettings::Pages::IncomeAmount.new(nil, nil, self),
- Form::Lettings::Pages::NetIncomeValueCheck.new(nil, nil, self),n
+ Form::Lettings::Pages::NetIncomeValueCheck.new(nil, nil, self),
Form::Lettings::Pages::HousingBenefit.new("housing_benefit", nil, self),
Form::Lettings::Pages::BenefitsProportion.new("benefits_proportion", nil, self),
Form::Lettings::Pages::RentOrOtherCharges.new(nil, nil, self),
@@ -25,9 +25,9 @@ class Form::Lettings::Subsections::IncomeAndBenefits < ::Form::Subsection
Form::Lettings::Pages::Rent4Weekly.new(nil, nil, self),
Form::Lettings::Pages::RentMonthly.new(nil, nil, self),
Form::Lettings::Pages::RentValueCheck.new("brent_rent_value_check", nil, self, check_answers_card_number: 0),
- Form::Lettings::Pages::SchargeValueCheck.new(nil, nil, self), # soft validation
- Form::Lettings::Pages::PschargeValueCheck.new(nil, nil, self), # soft validation
- Form::Lettings::Pages::SupchargValueCheck.new(nil, nil, self), # soft validation
+ Form::Lettings::Pages::SchargeValueCheck.new(nil, nil, self),
+ Form::Lettings::Pages::PschargeValueCheck.new(nil, nil, self),
+ Form::Lettings::Pages::SupchargValueCheck.new(nil, nil, self),
Form::Lettings::Pages::Outstanding.new(nil, nil, self),
Form::Lettings::Pages::OutstandingAmount.new(nil, nil, self),
].compact
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..70ea34ad0
--- /dev/null
+++ b/config/locales/forms/2024/lettings/soft_validations.en.yml
@@ -0,0 +1,131 @@
+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:
- under 16 years old
- over 50 years old
"
+
+ 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."
+
+ 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:- the decimal point
- the frequency, for example every week or every calendar month
- the rent type is correct, for example affordable or social rent
"
+ 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:- the decimal point
- the frequency, for example every week or every calendar month
- the needs type
"
+ 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:- the decimal point
- the frequency, for example every week or every calendar month
- the needs type
"
+ 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:- the decimal point
- the frequency, for example every week or every calendar month
- the needs type
"
+ 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/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..56738df92 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.carehome_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.carehome_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 e199f55d3..9126a2832 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 dd6f20d89..28344776a 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)