Browse Source

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 <rachael.booth@softwire.com>
pull/2744/head^2
kosiakkatrina 5 months ago committed by GitHub
parent
commit
020b8a4f4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      app/helpers/interruption_screen_helper.rb
  2. 8
      app/models/form/lettings/pages/care_home_charges_value_check.rb
  3. 9
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_age_value_check.rb
  4. 9
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_hhmemb_value_check.rb
  5. 9
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_lead_value_check.rb
  6. 21
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check.rb
  7. 22
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check.rb
  8. 9
      app/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_value_check.rb
  9. 6
      app/models/form/lettings/pages/lead_tenant_over_retirement_value_check.rb
  10. 8
      app/models/form/lettings/pages/lead_tenant_under_retirement_value_check.rb
  11. 8
      app/models/form/lettings/pages/multiple_partners_value_check.rb
  12. 5
      app/models/form/lettings/pages/net_income_value_check.rb
  13. 9
      app/models/form/lettings/pages/no_females_pregnant_household_lead_age_value_check.rb
  14. 9
      app/models/form/lettings/pages/no_females_pregnant_household_lead_hhmemb_value_check.rb
  15. 9
      app/models/form/lettings/pages/no_females_pregnant_household_lead_value_check.rb
  16. 9
      app/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check.rb
  17. 9
      app/models/form/lettings/pages/no_females_pregnant_household_person_value_check.rb
  18. 9
      app/models/form/lettings/pages/no_females_pregnant_household_value_check.rb
  19. 8
      app/models/form/lettings/pages/partner_under_16_value_check.rb
  20. 6
      app/models/form/lettings/pages/person_over_retirement_value_check.rb
  21. 8
      app/models/form/lettings/pages/person_under_retirement_value_check.rb
  22. 5
      app/models/form/lettings/pages/property_major_repairs_value_check.rb
  23. 8
      app/models/form/lettings/pages/pscharge_value_check.rb
  24. 5
      app/models/form/lettings/pages/reasonother_value_check.rb
  25. 5
      app/models/form/lettings/pages/referral_value_check.rb
  26. 5
      app/models/form/lettings/pages/rent_value_check.rb
  27. 8
      app/models/form/lettings/pages/scharge_value_check.rb
  28. 8
      app/models/form/lettings/pages/supcharg_value_check.rb
  29. 5
      app/models/form/lettings/pages/void_date_value_check.rb
  30. 3
      app/models/form/lettings/questions/care_home_charges_value_check.rb
  31. 3
      app/models/form/lettings/questions/major_repairs_date_value_check.rb
  32. 3
      app/models/form/lettings/questions/multiple_partners_value_check.rb
  33. 3
      app/models/form/lettings/questions/net_income_value_check.rb
  34. 3
      app/models/form/lettings/questions/no_retirement_value_check.rb
  35. 3
      app/models/form/lettings/questions/partner_under_16_value_check.rb
  36. 3
      app/models/form/lettings/questions/pregnancy_value_check.rb
  37. 4
      app/models/form/lettings/questions/pscharge_value_check.rb
  38. 3
      app/models/form/lettings/questions/reasonother_value_check.rb
  39. 3
      app/models/form/lettings/questions/referral_value_check.rb
  40. 4
      app/models/form/lettings/questions/rent_value_check.rb
  41. 3
      app/models/form/lettings/questions/retirement_value_check.rb
  42. 4
      app/models/form/lettings/questions/scharge_value_check.rb
  43. 4
      app/models/form/lettings/questions/supcharg_value_check.rb
  44. 3
      app/models/form/lettings/questions/void_date_value_check.rb
  45. 4
      config/forms/2021_2022.json
  46. 4
      config/forms/2022_2023.json
  47. 45
      config/locales/en.yml
  48. 132
      config/locales/forms/2023/lettings/soft_validations.en.yml
  49. 132
      config/locales/forms/2024/lettings/soft_validations.en.yml
  50. 132
      config/locales/forms/2025/lettings/soft_validations.en.yml
  51. 4
      spec/fixtures/forms/2021_2022.json
  52. 2
      spec/helpers/interruption_screen_helper_spec.rb
  53. 4
      spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb
  54. 40
      spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb
  55. 40
      spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb
  56. 11
      spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb
  57. 4
      spec/models/form/lettings/pages/net_income_value_check_spec.rb
  58. 40
      spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb
  59. 40
      spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb
  60. 27
      spec/models/form/lettings/pages/partner_under16_value_check_spec.rb
  61. 10
      spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb
  62. 8
      spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb
  63. 2
      spec/models/form/lettings/subsections/household_characteristics_spec.rb
  64. 3
      spec/models/form/lettings/subsections/household_needs_spec.rb
  65. 2
      spec/models/form/lettings/subsections/household_situation_spec.rb
  66. 3
      spec/models/form/lettings/subsections/income_and_benefits_spec.rb
  67. 4
      spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb
  68. 4
      spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb

2
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 = {}

8
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

9
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

9
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

9
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

21
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

22
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

9
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

6
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

8
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

8
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

5
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",

9
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

9
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

9
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

9
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

9
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

9
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

8
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

6
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

8
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

5
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

8
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

5
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

5
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

5
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",

8
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

8
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

5
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

3
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

3
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

3
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

3
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

3
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

3
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

3
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

4
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

3
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

3
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

4
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 }] }

3
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

4
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

4
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

3
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

4
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",

4
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",

45
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:<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>"
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:<ul><li>under 16 years old</li><li>over 50 years old</li></ul>"
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:<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>"
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."

132
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:<ul class=\"govuk-body-l app-panel--interruption\"><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."
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:<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."

132
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:<ul class=\"govuk-body-l app-panel--interruption\"><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."
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:<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 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."

132
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:<ul class=\"govuk-body-l app-panel--interruption\"><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."
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:<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 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."

4
spec/fixtures/forms/2021_2022.json vendored

@ -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",

2
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",

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
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

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
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

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
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

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:) }
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

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
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

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
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

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
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

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:) }
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

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
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

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
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

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_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)

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_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)

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_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)

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_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)

4
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

4
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

Loading…
Cancel
Save