Browse Source

Update tests and 2024 soft validations

pull/2735/head
Kat 2 years ago
parent
commit
3a0329f3e8
  1. 8
      app/models/form/lettings/subsections/income_and_benefits.rb
  2. 131
      config/locales/forms/2024/lettings/soft_validations.en.yml
  3. 4
      spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb
  4. 40
      spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb
  5. 40
      spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb
  6. 11
      spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb
  7. 4
      spec/models/form/lettings/pages/net_income_value_check_spec.rb
  8. 40
      spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb
  9. 40
      spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb
  10. 27
      spec/models/form/lettings/pages/partner_under16_value_check_spec.rb
  11. 10
      spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb
  12. 8
      spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb
  13. 2
      spec/models/form/lettings/subsections/household_characteristics_spec.rb
  14. 3
      spec/models/form/lettings/subsections/household_needs_spec.rb
  15. 2
      spec/models/form/lettings/subsections/household_situation_spec.rb
  16. 3
      spec/models/form/lettings/subsections/income_and_benefits_spec.rb

8
app/models/form/lettings/subsections/income_and_benefits.rb

@ -10,7 +10,7 @@ class Form::Lettings::Subsections::IncomeAndBenefits < ::Form::Subsection
@pages ||= [ @pages ||= [
Form::Lettings::Pages::IncomeKnown.new(nil, nil, self), Form::Lettings::Pages::IncomeKnown.new(nil, nil, self),
Form::Lettings::Pages::IncomeAmount.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::HousingBenefit.new("housing_benefit", nil, self),
Form::Lettings::Pages::BenefitsProportion.new("benefits_proportion", nil, self), Form::Lettings::Pages::BenefitsProportion.new("benefits_proportion", nil, self),
Form::Lettings::Pages::RentOrOtherCharges.new(nil, 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::Rent4Weekly.new(nil, nil, self),
Form::Lettings::Pages::RentMonthly.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::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::SchargeValueCheck.new(nil, nil, self),
Form::Lettings::Pages::PschargeValueCheck.new(nil, nil, self), # soft validation Form::Lettings::Pages::PschargeValueCheck.new(nil, nil, self),
Form::Lettings::Pages::SupchargValueCheck.new(nil, nil, self), # soft validation Form::Lettings::Pages::SupchargValueCheck.new(nil, nil, self),
Form::Lettings::Pages::Outstanding.new(nil, nil, self), Form::Lettings::Pages::Outstanding.new(nil, nil, self),
Form::Lettings::Pages::OutstandingAmount.new(nil, nil, self), Form::Lettings::Pages::OutstandingAmount.new(nil, nil, self),
].compact ].compact

131
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:<ul><li>under 16 years old</li><li>over 50 years old</li></ul>"
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:<ul class=\"govuk-body-l app-panel--interruption\"><li>the decimal point</li><li>the frequency, for example every week or every calendar month</li><li>the rent type is correct, for example affordable or social rent</li></ul>"
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:<ul class=\"govuk-body-l app-panel--interruption\"><li>the decimal point</li><li>the frequency, for example every week or every calendar month</li><li>the needs type</li></ul>"
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:<ul class=\"govuk-body-l app-panel--interruption\"><li>the decimal point</li><li>the frequency, for example every week or every calendar month</li><li>the needs type</li></ul>"
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:<ul class=\"govuk-body-l app-panel--interruption\"><li>the decimal point</li><li>the frequency, for example every week or every calendar month</li><li>the needs type</li></ul>"
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."

4
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 it "has the correct title_text" do
expect(page.title_text).to eq({ 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 end
it "has the correct informative_text" do 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 end
it "has the correct interruption_screen_question_ids" do it "has the correct interruption_screen_question_ids" do

40
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 it "has the correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.title_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}) })
end end
it "has the correct informative_text" do it "has the correct informative_text" do
expect(page.informative_text).to eq({ expect(page.informative_text).to eq({
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.informative_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}) })
end end
end end
@ -82,27 +70,15 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe
it "has the correct title_text" do it "has the correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.title_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}) })
end end
it "has the correct informative_text" do it "has the correct informative_text" do
expect(page.informative_text).to eq({ expect(page.informative_text).to eq({
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.informative_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}) })
end end
end end

40
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 it "has the correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.title_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}) })
end end
it "has the correct informative_text" do it "has the correct informative_text" do
expect(page.informative_text).to eq({ expect(page.informative_text).to eq({
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.informative_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}) })
end end
end end
@ -82,27 +70,15 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe
it "has the correct title_text" do it "has the correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.title_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}) })
end end
it "has the correct informative_text" do it "has the correct informative_text" do
expect(page.informative_text).to eq({ expect(page.informative_text).to eq({
"translation" => "soft_validations.pregnancy.females_not_in_soft_age_range", "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.females_in_soft_age_range_in_pregnant_household_value_check.informative_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}) })
end end
end end

11
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:) } subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
let(:person_index) { 1 } let(:person_index) { 1 }
let(:page_id) { "multiple_partners_value_check" } 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 it "has correct title_text" do
expect(page.title_text).to eq({ 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" => [], "arguments" => [],
}) })
end end
it "has correct informative_text" do 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 end
it "has correct interruption_screen_question_ids" do 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 it "has correct title_text" do
expect(page.title_text).to eq({ 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" => [], "arguments" => [],
}) })
end end
it "has correct informative_text" do 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 end
it "has correct interruption_screen_question_ids" do it "has correct interruption_screen_question_ids" do

4
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 end
it "has the correct title_text" do 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 end
it "has the correct informative_text" do it "has the correct informative_text" do
expect(page.informative_text).to eq({ expect(page.informative_text).to eq({
"arguments" => [{ "i18n_template" => "net_income_higher_or_lower_text", "key" => "net_income_higher_or_lower_text", "label" => false }], "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
end end

40
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 it "has the correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.title_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}) })
end end
it "has the correct informative_text" do it "has the correct informative_text" do
expect(page.informative_text).to eq({ expect(page.informative_text).to eq({
"translation" => "soft_validations.pregnancy.all_male_tenants", "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.informative_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}) })
end end
end end
@ -82,27 +70,15 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCh
it "has the correct title_text" do it "has the correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.title_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}) })
end end
it "has the correct informative_text" do it "has the correct informative_text" do
expect(page.informative_text).to eq({ expect(page.informative_text).to eq({
"translation" => "soft_validations.pregnancy.all_male_tenants", "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.informative_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}) })
end end
end end

40
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 it "has the correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.title_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}) })
end end
it "has the correct informative_text" do it "has the correct informative_text" do
expect(page.informative_text).to eq({ expect(page.informative_text).to eq({
"translation" => "soft_validations.pregnancy.all_male_tenants", "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.informative_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}) })
end end
end end
@ -82,27 +70,15 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck
it "has the correct title_text" do it "has the correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.pregnancy.title", "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.title_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}) })
end end
it "has the correct informative_text" do it "has the correct informative_text" do
expect(page.informative_text).to eq({ expect(page.informative_text).to eq({
"translation" => "soft_validations.pregnancy.all_male_tenants", "translation" => "forms.2024.lettings.soft_validations.pregnancy_value_check.no_females_pregnant_household_value_check.informative_text",
"arguments" => [ "arguments" => [],
{
"key" => "sex1",
"label" => true,
"i18n_template" => "sex1",
},
],
}) })
end end
end end

27
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:) } subject(:page) { described_class.new(page_id, page_definition, subsection, person_index:) }
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) } let(:form) { instance_double(Form, start_date: Time.zone.local(2024, 4, 1)) }
let(:subsection) { instance_double(Form::Subsection, form:) }
let(:person_index) { 1 } let(:person_index) { 1 }
let(:page_id) { "partner_under_16_value_check" } 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 it "has correct title_text" do
expect(page.title_text).to eq({ 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" => [ "arguments" => [
{ {
"key" => "age1", "key" => "age1",
@ -51,7 +52,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do
end end
it "has correct informative_text" do 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 end
it "has correct interruption_screen_question_ids" do 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 it "has correct title_text" do
expect(page.title_text).to eq({ 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" => [ "arguments" => [
{ {
"key" => "age2", "key" => "age2",
@ -89,7 +90,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do
end end
it "has correct informative_text" do 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 end
it "has correct interruption_screen_question_ids" do 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 it "has correct title_text" do
expect(page.title_text).to eq({ 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" => [ "arguments" => [
{ {
"key" => "age3", "key" => "age3",
@ -127,7 +128,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do
end end
it "has correct informative_text" do 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 end
it "has correct interruption_screen_question_ids" do 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 it "has correct title_text" do
expect(page.title_text).to eq({ 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" => [ "arguments" => [
{ {
"key" => "age4", "key" => "age4",
@ -165,7 +166,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do
end end
it "has correct informative_text" do 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 end
it "has correct interruption_screen_question_ids" do 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 it "has correct title_text" do
expect(page.title_text).to eq({ 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" => [ "arguments" => [
{ {
"key" => "age5", "key" => "age5",
@ -203,7 +204,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do
end end
it "has correct informative_text" do 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 end
it "has correct interruption_screen_question_ids" do 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 it "has correct title_text" do
expect(page.title_text).to eq({ 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" => [ "arguments" => [
{ {
"key" => "age6", "key" => "age6",
@ -241,7 +242,7 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do
end end
it "has correct informative_text" do 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 end
it "has correct interruption_screen_question_ids" do it "has correct interruption_screen_question_ids" do

10
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 it "has the correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.retirement.max.title", "translation" => "forms.2024.lettings.soft_validations.retirement_value_check.title_text",
}) })
end end
it "has the correct informative_text" do it "has the correct informative_text" do
expect(page.informative_text).to eq({ 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
end end
@ -50,13 +51,14 @@ RSpec.describe Form::Lettings::Pages::PersonOverRetirementValueCheck, type: :mod
it "has the correct title_text" do it "has the correct title_text" do
expect(page.title_text).to eq({ expect(page.title_text).to eq({
"translation" => "soft_validations.retirement.max.title", "translation" => "forms.2024.lettings.soft_validations.retirement_value_check.title_text",
}) })
end end
it "has the correct informative_text" do it "has the correct informative_text" do
expect(page.informative_text).to eq({ 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
end end

8
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 it "has the correct title_text" do
expect(page.title_text).to eq({ 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" => [ "arguments" => [
{ {
"key" => "age2", "key" => "age2",
@ -40,7 +40,7 @@ RSpec.describe Form::Lettings::Pages::PersonUnderRetirementValueCheck, type: :mo
end end
it "has the correct informative_text" do 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 end
@ -55,7 +55,7 @@ RSpec.describe Form::Lettings::Pages::PersonUnderRetirementValueCheck, type: :mo
it "has the correct title_text" do it "has the correct title_text" do
expect(page.title_text).to eq({ 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" => [ "arguments" => [
{ {
"key" => "age3", "key" => "age3",
@ -67,7 +67,7 @@ RSpec.describe Form::Lettings::Pages::PersonUnderRetirementValueCheck, type: :mo
end end
it "has the correct informative_text" do 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 end
end end

2
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_id) { nil }
let(:subsection_definition) { nil } let(:subsection_definition) { nil }
let(:section) { instance_double(Form::Lettings::Sections::Household) } 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 before do
allow(section).to receive(:form).and_return(form) allow(section).to receive(:form).and_return(form)

3
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_id) { nil }
let(:subsection_definition) { 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 it "has correct section" do
expect(household_needs.section).to eq(section) expect(household_needs.section).to eq(section)

2
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_id) { nil }
let(:subsection_definition) { nil } let(:subsection_definition) { nil }
let(:section) { instance_double(Form::Lettings::Sections::Household) } 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 before do
allow(section).to receive(:form).and_return(form) allow(section).to receive(:form).and_return(form)

3
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_id) { nil }
let(:subsection_definition) { 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 it "has correct section" do
expect(income_and_benefits.section).to eq(section) expect(income_and_benefits.section).to eq(section)

Loading…
Cancel
Save