From ff3f789acc96cfa636cd7c46ba16a12272ed4f50 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Wed, 30 Oct 2024 10:54:45 +0000 Subject: [PATCH] CLDC-3681 Extract lettings household characteristics copy (#2728) * Extract lettings household characteristics copy * Update cya labels for age known * Update missing keys and copy --- .../form/lettings/pages/lead_tenant_age.rb | 1 + .../lead_tenant_ethnic_background_arab.rb | 1 + .../lead_tenant_ethnic_background_asian.rb | 1 + .../lead_tenant_ethnic_background_black.rb | 1 + .../lead_tenant_ethnic_background_mixed.rb | 1 + .../lead_tenant_ethnic_background_white.rb | 1 + .../lettings/pages/lead_tenant_nationality.rb | 1 + app/models/form/lettings/pages/person_age.rb | 9 +- .../form/lettings/pages/person_known.rb | 1 - app/models/form/lettings/questions/age.rb | 8 +- app/models/form/lettings/questions/age1.rb | 3 +- .../form/lettings/questions/age1_known.rb | 11 +- .../form/lettings/questions/age_known.rb | 4 +- .../form/lettings/questions/declaration.rb | 2 - .../form/lettings/questions/details_known.rb | 3 - .../form/lettings/questions/ethnic_arab.rb | 4 +- .../form/lettings/questions/ethnic_asian.rb | 4 +- .../form/lettings/questions/ethnic_black.rb | 4 +- .../form/lettings/questions/ethnic_group.rb | 3 - .../form/lettings/questions/ethnic_mixed.rb | 4 +- .../form/lettings/questions/ethnic_white.rb | 4 +- .../lettings/questions/gender_identity1.rb | 10 - app/models/form/lettings/questions/hhmemb.rb | 3 - .../form/lettings/questions/nationality.rb | 3 - .../lettings/questions/nationality_all.rb | 3 +- .../questions/nationality_all_group.rb | 4 +- .../questions/person_gender_identity.rb | 10 - .../lettings/questions/person_relationship.rb | 3 - .../questions/person_working_situation.rb | 3 - .../lettings/questions/working_situation1.rb | 3 - .../subsections/household_characteristics.rb | 7 - .../lettings/household_characteristics.en.yml | 323 ++++++++++++++++++ .../lettings/household_characteristics.en.yml | 322 +++++++++++++++++ .../form/lettings/pages/person_age_spec.rb | 35 +- .../form/lettings/questions/age_spec.rb | 3 +- .../household_characteristics_spec.rb | 42 +-- 36 files changed, 692 insertions(+), 153 deletions(-) create mode 100644 config/locales/forms/2023/lettings/household_characteristics.en.yml create mode 100644 config/locales/forms/2024/sales/lettings/household_characteristics.en.yml diff --git a/app/models/form/lettings/pages/lead_tenant_age.rb b/app/models/form/lettings/pages/lead_tenant_age.rb index 640d23142..3058d8a77 100644 --- a/app/models/form/lettings/pages/lead_tenant_age.rb +++ b/app/models/form/lettings/pages/lead_tenant_age.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantAge < ::Form::Page def initialize(id, hsh, subsection) super @id = "lead_tenant_age" + @copy_key = "lettings.household_characteristics.age1" @depends_on = [{ "declaration" => 1 }] end diff --git a/app/models/form/lettings/pages/lead_tenant_ethnic_background_arab.rb b/app/models/form/lettings/pages/lead_tenant_ethnic_background_arab.rb index 89d73fd34..fe038aa78 100644 --- a/app/models/form/lettings/pages/lead_tenant_ethnic_background_arab.rb +++ b/app/models/form/lettings/pages/lead_tenant_ethnic_background_arab.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundArab < ::Form::Page def initialize(id, hsh, subsection) super @id = "lead_tenant_ethnic_background_arab" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_arab" @depends_on = [{ "ethnic_group" => 4 }] end diff --git a/app/models/form/lettings/pages/lead_tenant_ethnic_background_asian.rb b/app/models/form/lettings/pages/lead_tenant_ethnic_background_asian.rb index d55ce9837..9f01300d1 100644 --- a/app/models/form/lettings/pages/lead_tenant_ethnic_background_asian.rb +++ b/app/models/form/lettings/pages/lead_tenant_ethnic_background_asian.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundAsian < ::Form::Page def initialize(id, hsh, subsection) super @id = "lead_tenant_ethnic_background_asian" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_asian" @depends_on = [{ "ethnic_group" => 2 }] end diff --git a/app/models/form/lettings/pages/lead_tenant_ethnic_background_black.rb b/app/models/form/lettings/pages/lead_tenant_ethnic_background_black.rb index 7ce2ef9c4..68bcffb1c 100644 --- a/app/models/form/lettings/pages/lead_tenant_ethnic_background_black.rb +++ b/app/models/form/lettings/pages/lead_tenant_ethnic_background_black.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundBlack < ::Form::Page def initialize(id, hsh, subsection) super @id = "lead_tenant_ethnic_background_black" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_black" @depends_on = [{ "ethnic_group" => 3 }] end diff --git a/app/models/form/lettings/pages/lead_tenant_ethnic_background_mixed.rb b/app/models/form/lettings/pages/lead_tenant_ethnic_background_mixed.rb index a4c225083..fd1e52c11 100644 --- a/app/models/form/lettings/pages/lead_tenant_ethnic_background_mixed.rb +++ b/app/models/form/lettings/pages/lead_tenant_ethnic_background_mixed.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundMixed < ::Form::Page def initialize(id, hsh, subsection) super @id = "lead_tenant_ethnic_background_mixed" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_mixed" @depends_on = [{ "ethnic_group" => 1 }] end diff --git a/app/models/form/lettings/pages/lead_tenant_ethnic_background_white.rb b/app/models/form/lettings/pages/lead_tenant_ethnic_background_white.rb index 994e6e159..e457c39fe 100644 --- a/app/models/form/lettings/pages/lead_tenant_ethnic_background_white.rb +++ b/app/models/form/lettings/pages/lead_tenant_ethnic_background_white.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantEthnicBackgroundWhite < ::Form::Page def initialize(id, hsh, subsection) super @id = "lead_tenant_ethnic_background_white" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_white" @depends_on = [{ "ethnic_group" => 0 }] end diff --git a/app/models/form/lettings/pages/lead_tenant_nationality.rb b/app/models/form/lettings/pages/lead_tenant_nationality.rb index 9fc78644f..d4845f8f9 100644 --- a/app/models/form/lettings/pages/lead_tenant_nationality.rb +++ b/app/models/form/lettings/pages/lead_tenant_nationality.rb @@ -2,6 +2,7 @@ class Form::Lettings::Pages::LeadTenantNationality < ::Form::Page def initialize(id, hsh, subsection) super @id = "lead_tenant_nationality" + @copy_key = "lettings.household_characteristics.#{form.start_year_after_2024? ? 'nationality_all' : 'national'}" @depends_on = [{ "declaration" => 1 }] end diff --git a/app/models/form/lettings/pages/person_age.rb b/app/models/form/lettings/pages/person_age.rb index bbb5da01e..3e6a73e14 100644 --- a/app/models/form/lettings/pages/person_age.rb +++ b/app/models/form/lettings/pages/person_age.rb @@ -1,13 +1,12 @@ class Form::Lettings::Pages::PersonAge < ::Form::Page - def initialize(id, hsh, subsection, person_index:, person_type: "non_child") + def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) - @id = "person_#{person_index}_age_#{person_type}" + @id = "person_#{person_index}_age" + @copy_key = "lettings.household_characteristics.age#{person_index}" @person_index = person_index - @person_type = person_type @depends_on = [ { "details_known_#{person_index}" => 0, - "person_#{person_index}_child_relation?" => (person_type == "child"), }, ] end @@ -15,7 +14,7 @@ class Form::Lettings::Pages::PersonAge < ::Form::Page def questions @questions ||= [ Form::Lettings::Questions::AgeKnown.new(nil, nil, self, person_index: @person_index), - Form::Lettings::Questions::Age.new(nil, nil, self, person_index: @person_index, person_type: @person_type), + Form::Lettings::Questions::Age.new(nil, nil, self, person_index: @person_index), ] end end diff --git a/app/models/form/lettings/pages/person_known.rb b/app/models/form/lettings/pages/person_known.rb index b864ab708..6e699926d 100644 --- a/app/models/form/lettings/pages/person_known.rb +++ b/app/models/form/lettings/pages/person_known.rb @@ -2,7 +2,6 @@ class Form::Lettings::Pages::PersonKnown < ::Form::Page def initialize(id, hsh, subsection, person_index:) super(id, hsh, subsection) @id = "person_#{person_index}_known" - @header = "You’ve given us the details for #{person_index - 1} person in the household" @depends_on = (person_index..8).map { |index| { "hhmemb" => index } } @person_index = person_index end diff --git a/app/models/form/lettings/questions/age.rb b/app/models/form/lettings/questions/age.rb index 0a457203c..b861cb39f 100644 --- a/app/models/form/lettings/questions/age.rb +++ b/app/models/form/lettings/questions/age.rb @@ -1,9 +1,8 @@ class Form::Lettings::Questions::Age < ::Form::Question - def initialize(id, hsh, page, person_index:, person_type:) + def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "age#{person_index}" - @check_answer_label = "Person #{person_index}’s age" - @header = "Age" + @copy_key = "lettings.household_characteristics.age#{person_index}.age#{person_index}" @type = "numeric" @width = 2 @inferred_check_answers_value = [{ "condition" => { "age#{person_index}_known" => 1 }, "value" => "Not known" }] @@ -13,7 +12,6 @@ class Form::Lettings::Questions::Age < ::Form::Question @step = 1 @person_index = person_index @question_number = question_number - @person_type = person_type @hint_text = hint_text end @@ -31,8 +29,6 @@ class Form::Lettings::Questions::Age < ::Form::Question def hint_text if form.start_year_after_2024? "Answer 1 for children aged under 1 year old" - elsif @person_type == "child" - "For a child under 1, enter 1" end end end diff --git a/app/models/form/lettings/questions/age1.rb b/app/models/form/lettings/questions/age1.rb index 922345e65..72d89096c 100644 --- a/app/models/form/lettings/questions/age1.rb +++ b/app/models/form/lettings/questions/age1.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::Age1 < ::Form::Question def initialize(id, hsh, page) super @id = "age1" - @check_answer_label = "Lead tenant’s age" - @header = "Age" + @copy_key = "lettings.household_characteristics.age1.age1" @type = "numeric" @width = 2 @inferred_check_answers_value = [{ "condition" => { "age1_known" => 1 }, "value" => "Not known" }] diff --git a/app/models/form/lettings/questions/age1_known.rb b/app/models/form/lettings/questions/age1_known.rb index 27c185de4..e54d7993b 100644 --- a/app/models/form/lettings/questions/age1_known.rb +++ b/app/models/form/lettings/questions/age1_known.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::Age1Known < ::Form::Question def initialize(id, hsh, page) super @id = "age1_known" - @check_answer_label = "" - @header = "Do you know the lead tenant’s age?" + @copy_key = "lettings.household_characteristics.age1.age1_known" @type = "radio" @check_answers_card_number = 1 @answer_options = ANSWER_OPTIONS @@ -14,13 +13,5 @@ class Form::Lettings::Questions::Age1Known < ::Form::Question ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze - def hint_text - if form.start_year_after_2024? - "The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same amount of paid work, the lead tenant is whoever is the oldest." - else - "The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 32, 2024 => 31 }.freeze end diff --git a/app/models/form/lettings/questions/age_known.rb b/app/models/form/lettings/questions/age_known.rb index 10ae7dad5..2f5d7ce0b 100644 --- a/app/models/form/lettings/questions/age_known.rb +++ b/app/models/form/lettings/questions/age_known.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::AgeKnown < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "age#{person_index}_known" - @check_answer_label = "" - @header = "Do you know person #{person_index}’s age?" + @copy_key = "lettings.household_characteristics.age#{person_index}.age#{person_index}_known" @type = "radio" @check_answers_card_number = person_index - @hint_text = "" @answer_options = ANSWER_OPTIONS @conditional_for = { "age#{person_index}" => [0] } @hidden_in_check_answers = { diff --git a/app/models/form/lettings/questions/declaration.rb b/app/models/form/lettings/questions/declaration.rb index 5d3f6d76b..c88c7cf3c 100644 --- a/app/models/form/lettings/questions/declaration.rb +++ b/app/models/form/lettings/questions/declaration.rb @@ -2,8 +2,6 @@ class Form::Lettings::Questions::Declaration < ::Form::Question def initialize(id, hsh, page) super @id = "declaration" - @check_answer_label = "Tenant has seen the privacy notice" - @header = "Declaration" @type = "checkbox" @check_answers_card_number = 0 unless form.start_year_after_2024? @top_guidance_partial = form.start_year_after_2024? ? "privacy_notice_tenant_2024" : "privacy_notice_tenant" diff --git a/app/models/form/lettings/questions/details_known.rb b/app/models/form/lettings/questions/details_known.rb index f2850b65e..fda7a2eb7 100644 --- a/app/models/form/lettings/questions/details_known.rb +++ b/app/models/form/lettings/questions/details_known.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::DetailsKnown < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "details_known_#{person_index}" - @check_answer_label = "Details known for person #{person_index}" - @header = "Do you know details for person #{person_index}?" @type = "radio" @check_answers_card_number = person_index - @hint_text = "You must provide details for everyone in the household if you know them." @answer_options = ANSWER_OPTIONS end diff --git a/app/models/form/lettings/questions/ethnic_arab.rb b/app/models/form/lettings/questions/ethnic_arab.rb index 380de645f..d642c1a1b 100644 --- a/app/models/form/lettings/questions/ethnic_arab.rb +++ b/app/models/form/lettings/questions/ethnic_arab.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicArab < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic" - @check_answer_label = "Lead tenant’s ethnic background" - @header = "Which of the following best describes the lead tenant’s Arab background?" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_arab" @type = "radio" @check_answers_card_number = 1 - @hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/ethnic_asian.rb b/app/models/form/lettings/questions/ethnic_asian.rb index 33002533b..7fb309bba 100644 --- a/app/models/form/lettings/questions/ethnic_asian.rb +++ b/app/models/form/lettings/questions/ethnic_asian.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicAsian < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic" - @check_answer_label = "Lead tenant’s ethnic background" - @header = "Which of the following best describes the lead tenant’s Asian or Asian British background?" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_asian" @type = "radio" @check_answers_card_number = 1 - @hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/ethnic_black.rb b/app/models/form/lettings/questions/ethnic_black.rb index 16a886eb3..e3a88259e 100644 --- a/app/models/form/lettings/questions/ethnic_black.rb +++ b/app/models/form/lettings/questions/ethnic_black.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicBlack < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic" - @check_answer_label = "Lead tenant’s ethnic background" - @header = "Which of the following best describes the lead tenant’s Black, African, Caribbean or Black British background?" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_black" @type = "radio" @check_answers_card_number = 1 - @hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/ethnic_group.rb b/app/models/form/lettings/questions/ethnic_group.rb index c3093d48e..16bdfc4ba 100644 --- a/app/models/form/lettings/questions/ethnic_group.rb +++ b/app/models/form/lettings/questions/ethnic_group.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::EthnicGroup < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic_group" - @check_answer_label = "Lead tenant’s ethnic group" - @header = "What is the lead tenant’s ethnic group?" @type = "radio" @check_answers_card_number = 1 - @hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/ethnic_mixed.rb b/app/models/form/lettings/questions/ethnic_mixed.rb index cd7d7a4bb..14d1f213b 100644 --- a/app/models/form/lettings/questions/ethnic_mixed.rb +++ b/app/models/form/lettings/questions/ethnic_mixed.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicMixed < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic" - @check_answer_label = "Lead tenant’s ethnic background" - @header = "Which of the following best describes the lead tenant’s Mixed or Multiple ethnic groups background?" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_mixed" @type = "radio" @check_answers_card_number = 1 - @hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/ethnic_white.rb b/app/models/form/lettings/questions/ethnic_white.rb index 9c042b576..40b99bc9f 100644 --- a/app/models/form/lettings/questions/ethnic_white.rb +++ b/app/models/form/lettings/questions/ethnic_white.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::EthnicWhite < ::Form::Question def initialize(id, hsh, page) super @id = "ethnic" - @check_answer_label = "Lead tenant’s ethnic background" - @header = "Which of the following best describes the lead tenant’s White background?" + @copy_key = "lettings.household_characteristics.ethnic.ethnic_background_white" @type = "radio" @check_answers_card_number = 1 - @hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/gender_identity1.rb b/app/models/form/lettings/questions/gender_identity1.rb index eefe20e15..411bcd3d0 100644 --- a/app/models/form/lettings/questions/gender_identity1.rb +++ b/app/models/form/lettings/questions/gender_identity1.rb @@ -2,8 +2,6 @@ class Form::Lettings::Questions::GenderIdentity1 < ::Form::Question def initialize(id, hsh, page) super @id = "sex1" - @check_answer_label = "Lead tenant’s gender identity" - @header = "Which of these best describes the lead tenant’s gender identity?" @type = "radio" @check_answers_card_number = 1 @answer_options = ANSWER_OPTIONS @@ -18,13 +16,5 @@ class Form::Lettings::Questions::GenderIdentity1 < ::Form::Question "R" => { "value" => "Tenant prefers not to say" }, }.freeze - def hint_text - if form.start_year_after_2024? - "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." - else - "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 33, 2024 => 32 }.freeze end diff --git a/app/models/form/lettings/questions/hhmemb.rb b/app/models/form/lettings/questions/hhmemb.rb index bd874d544..61fad98ef 100644 --- a/app/models/form/lettings/questions/hhmemb.rb +++ b/app/models/form/lettings/questions/hhmemb.rb @@ -2,14 +2,11 @@ class Form::Lettings::Questions::Hhmemb < ::Form::Question def initialize(id, hsh, page) super @id = "hhmemb" - @check_answer_label = "Number of household members" - @header = "How many people live in the household for this letting?" @type = "numeric" @width = 2 @check_answers_card_number = 0 @max = 8 @min = 1 - @hint_text = "You can provide details for a maximum of 8 people." @step = 1 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/nationality.rb b/app/models/form/lettings/questions/nationality.rb index 51cbec936..8c4a700c1 100644 --- a/app/models/form/lettings/questions/nationality.rb +++ b/app/models/form/lettings/questions/nationality.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::Nationality < ::Form::Question def initialize(id, hsh, page) super @id = "national" - @check_answer_label = "Lead tenant’s nationality" - @header = "What is the nationality of the lead tenant?" @type = "radio" @check_answers_card_number = 1 - @hint_text = "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/questions/nationality_all.rb b/app/models/form/lettings/questions/nationality_all.rb index a8324595f..8a0e3d1d9 100644 --- a/app/models/form/lettings/questions/nationality_all.rb +++ b/app/models/form/lettings/questions/nationality_all.rb @@ -2,8 +2,7 @@ class Form::Lettings::Questions::NationalityAll < ::Form::Question def initialize(id, hsh, page) super @id = "nationality_all" - @check_answer_label = "Lead tenant’s nationality" - @header = "Enter a nationality" + @copy_key = "lettings.household_characteristics.nationality_all.nationality_all" @type = "select" @check_answers_card_number = 1 @answer_options = GlobalConstants::COUNTRIES_ANSWER_OPTIONS diff --git a/app/models/form/lettings/questions/nationality_all_group.rb b/app/models/form/lettings/questions/nationality_all_group.rb index 53534851b..559b1c9a0 100644 --- a/app/models/form/lettings/questions/nationality_all_group.rb +++ b/app/models/form/lettings/questions/nationality_all_group.rb @@ -2,11 +2,9 @@ class Form::Lettings::Questions::NationalityAllGroup < ::Form::Question def initialize(id, hsh, page) super @id = "nationality_all_group" - @check_answer_label = "Lead tenant’s nationality" - @header = "What is the nationality of the lead tenant?" + @copy_key = "lettings.household_characteristics.nationality_all.nationality_all_group" @type = "radio" @check_answers_card_number = 1 - @hint_text = "If the lead tenant is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the tenant should decide which country to enter." @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @conditional_for = { "nationality_all" => [12] } diff --git a/app/models/form/lettings/questions/person_gender_identity.rb b/app/models/form/lettings/questions/person_gender_identity.rb index 21244938d..0d76d23e3 100644 --- a/app/models/form/lettings/questions/person_gender_identity.rb +++ b/app/models/form/lettings/questions/person_gender_identity.rb @@ -2,8 +2,6 @@ class Form::Lettings::Questions::PersonGenderIdentity < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "sex#{person_index}" - @check_answer_label = "Person #{person_index}’s gender identity" - @header = "Which of these best describes person #{person_index}’s gender identity?" @type = "radio" @check_answers_card_number = person_index @answer_options = ANSWER_OPTIONS @@ -19,14 +17,6 @@ class Form::Lettings::Questions::PersonGenderIdentity < ::Form::Question "R" => { "value" => "Person prefers not to say" }, }.freeze - def hint_text - if form.start_year_after_2024? - "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." - else - "" - end - end - def question_number base_question_number = case form.start_date.year when 2023 diff --git a/app/models/form/lettings/questions/person_relationship.rb b/app/models/form/lettings/questions/person_relationship.rb index c20ec9f2c..ec7a78969 100644 --- a/app/models/form/lettings/questions/person_relationship.rb +++ b/app/models/form/lettings/questions/person_relationship.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::PersonRelationship < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "relat#{person_index}" - @check_answer_label = "Person #{person_index}’s relationship to the lead tenant" - @header = "What is person #{person_index}’s relationship to the lead tenant?" @type = "radio" @check_answers_card_number = person_index - @hint_text = "" @answer_options = answer_options @person_index = person_index @question_number = question_number diff --git a/app/models/form/lettings/questions/person_working_situation.rb b/app/models/form/lettings/questions/person_working_situation.rb index 3d223a943..cc4644f48 100644 --- a/app/models/form/lettings/questions/person_working_situation.rb +++ b/app/models/form/lettings/questions/person_working_situation.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::PersonWorkingSituation < ::Form::Question def initialize(id, hsh, page, person_index:) super(id, hsh, page) @id = "ecstat#{person_index}" - @check_answer_label = "Person #{person_index}’s working situation" - @header = "Which of these best describes person #{person_index}’s working situation?" @type = "radio" @check_answers_card_number = person_index - @hint_text = "" @person_index = person_index @question_number = question_number @answer_options = answer_options diff --git a/app/models/form/lettings/questions/working_situation1.rb b/app/models/form/lettings/questions/working_situation1.rb index b2facdf01..dbaf4fc7a 100644 --- a/app/models/form/lettings/questions/working_situation1.rb +++ b/app/models/form/lettings/questions/working_situation1.rb @@ -2,11 +2,8 @@ class Form::Lettings::Questions::WorkingSituation1 < ::Form::Question def initialize(id, hsh, page) super @id = "ecstat1" - @check_answer_label = "Lead tenant’s working situation" - @header = "Which of these best describes the lead tenant’s working situation?" @type = "radio" @check_answers_card_number = 1 - @hint_text = form.start_year_after_2024? ? "" : "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/lettings/subsections/household_characteristics.rb b/app/models/form/lettings/subsections/household_characteristics.rb index b74cc3792..e95cdf19c 100644 --- a/app/models/form/lettings/subsections/household_characteristics.rb +++ b/app/models/form/lettings/subsections/household_characteristics.rb @@ -35,7 +35,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 2), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_2_partner_under_16_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_2_multiple_partners_value_check", nil, self, person_index: 2) if form.start_year_after_2024?), - Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 2, person_type: "child"), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 2), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 2), @@ -56,7 +55,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 3), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_3_partner_under_16_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_3_multiple_partners_value_check", nil, self, person_index: 3) if form.start_year_after_2024?), - Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 3, person_type: "child"), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 3), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 3), @@ -77,7 +75,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 4), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_4_partner_under_16_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_4_multiple_partners_value_check", nil, self, person_index: 4) if form.start_year_after_2024?), - Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 4, person_type: "child"), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 4), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 4), @@ -98,7 +95,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 5), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_5_partner_under_16_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_5_multiple_partners_value_check", nil, self, person_index: 5) if form.start_year_after_2024?), - Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 5, person_type: "child"), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 5), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 5), @@ -119,7 +115,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 6), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_6_partner_under_16_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_6_multiple_partners_value_check", nil, self, person_index: 6) if form.start_year_after_2024?), - Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 6, person_type: "child"), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 6), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 6), @@ -140,7 +135,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 7), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_7_partner_under_16_value_check", nil, self, person_index: 7) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_7_multiple_partners_value_check", nil, self, person_index: 7) if form.start_year_after_2024?), - Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 7, person_type: "child"), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 7), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 7), @@ -161,7 +155,6 @@ class Form::Lettings::Subsections::HouseholdCharacteristics < ::Form::Subsection Form::Lettings::Pages::PersonRelationshipToLead.new(nil, nil, self, person_index: 8), (Form::Lettings::Pages::PartnerUnder16ValueCheck.new("relationship_8_partner_under_16_value_check", nil, self, person_index: 8) if form.start_year_after_2024?), (Form::Lettings::Pages::MultiplePartnersValueCheck.new("relationship_8_multiple_partners_value_check", nil, self, person_index: 8) if form.start_year_after_2024?), - Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 8, person_type: "child"), Form::Lettings::Pages::PersonAge.new(nil, nil, self, person_index: 8), Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCheck.new(nil, nil, self, person_index: 8), diff --git a/config/locales/forms/2023/lettings/household_characteristics.en.yml b/config/locales/forms/2023/lettings/household_characteristics.en.yml new file mode 100644 index 000000000..1f175adbc --- /dev/null +++ b/config/locales/forms/2023/lettings/household_characteristics.en.yml @@ -0,0 +1,323 @@ +en: + forms: + 2023: + lettings: + household_characteristics: + declaration: + page_header: "Ministry of Housing, Communities and Local Government privacy notice" + check_answer_label: "Tenant has seen the privacy notice" + hint_text: "" + question_text: "Declaration" + + hhmemb: + page_header: "" + check_answer_label: "Number of household members" + hint_text: "You can provide details for a maximum of 8 people." + question_text: "How many people live in the household for this letting?" + + age1: + page_header: "" + age1_known: + check_answer_label: "" + hint_text: "The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "Do you know the lead tenant’s age?" + age1: + check_answer_label: "Lead tenant’s age" + hint_text: "" + question_text: "Age" + + sex1: + page_header: "" + check_answer_label: "Lead tenant’s gender identity" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "Which of these best describes the lead tenant’s gender identity?" + + ethnic_group: + page_header: "" + check_answer_label: "Lead tenant’s ethnic group" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "What is the lead tenant’s ethnic group?" + + ethnic: + ethnic_background_black: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "Which of the following best describes lead tenant’s Black, African, Caribbean or Black British background?" + ethnic_background_asian: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "Which of the following best describes lead tenant’s Asian or Asian British background?" + ethnic_background_arab: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "Which of the following best describes the lead tenant’s Arab background?" + ethnic_background_mixed: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "Which of the following best describes lead tenant’s Mixed or Multiple ethnic groups background?" + ethnic_background_white: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "Which of the following best describes lead tenant’s White background?" + + national: + page_header: "" + check_answer_label: "Lead tenant’s nationality" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "What is the nationality of the lead tenant?" + + ecstat1: + page_header: "" + check_answer_label: "Lead tenant’s working situation" + hint_text: "The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest." + question_text: "Which of these best describes the lead tenant’s working situation?" + + details_known_2: + page_header: "You’ve given us the details for 1 person in the household" + check_answer_label: "Details known for person 2" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 2?" + + relat2: + page_header: "" + check_answer_label: "Person 2’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 2’s relationship to the lead tenant?" + + age2: + page_header: "" + age2_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 2’s age?" + age2: + check_answer_label: "Person 2’s age" + hint_text: "" + question_text: "Age" + + sex2: + page_header: "" + check_answer_label: "Person 2’s gender identity" + hint_text: "" + question_text: "Which of these best describes person 2’s gender identity?" + + ecstat2: + page_header: "" + check_answer_label: "Person 2’s working situation" + hint_text: "" + question_text: "Which of these best describes person 2’s working situation?" + + details_known_3: + page_header: "You’ve given us the details for 2 people in the household" + check_answer_label: "Details known for person 3" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 3?" + + relat3: + page_header: "" + check_answer_label: "Person 3’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 3’s relationship to the lead tenant?" + + age3: + page_header: "" + age3_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 3’s age?" + age3: + check_answer_label: "Person 3’s age" + hint_text: "" + question_text: "Age" + + sex3: + page_header: "" + check_answer_label: "Person 3’s gender identity" + hint_text: "" + question_text: "Which of these best describes person 3’s gender identity?" + + ecstat3: + page_header: "" + check_answer_label: "Person 3’s working situation" + hint_text: "" + question_text: "Which of these best describes person 3’s working situation?" + + details_known_4: + page_header: "You’ve given us the details for 3 people in the household" + check_answer_label: "Details known for person 4" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 4?" + + relat4: + page_header: "" + check_answer_label: "Person 4’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 4’s relationship to the lead tenant?" + + age4: + page_header: "" + age4_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 4’s age?" + age4: + check_answer_label: "Person 4’s age" + hint_text: "" + question_text: "Age" + + sex4: + page_header: "" + check_answer_label: "Person 4’s gender identity" + hint_text: "" + question_text: "Which of these best describes person 4’s gender identity?" + + ecstat4: + page_header: "" + check_answer_label: "Person 4’s working situation" + hint_text: "" + question_text: "Which of these best describes person 4’s working situation?" + + details_known_5: + page_header: "You’ve given us the details for 4 people in the household" + check_answer_label: "Details known for person 5" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 5?" + + relat5: + page_header: "" + check_answer_label: "Person 5’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 5’s relationship to the lead tenant?" + + age5: + page_header: "" + age5_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 5’s age?" + age5: + check_answer_label: "Person 5’s age" + hint_text: "" + question_text: "Age" + + sex5: + page_header: "" + check_answer_label: "Person 5’s gender identity" + hint_text: "" + question_text: "Which of these best describes person 5’s gender identity?" + + ecstat5: + page_header: "" + check_answer_label: "Person 5’s working situation" + hint_text: "" + question_text: "Which of these best describes person 5’s working situation?" + + details_known_6: + page_header: "You’ve given us the details for 5 people in the household" + check_answer_label: "Details known for person 6" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 6?" + + relat6: + page_header: "" + check_answer_label: "Person 6’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 6’s relationship to the lead tenant?" + + age6: + page_header: "" + age6_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 6’s age?" + age6: + check_answer_label: "Person 6’s age" + hint_text: "" + question_text: "Age" + + sex6: + page_header: "" + check_answer_label: "Person 6’s gender identity" + hint_text: "" + question_text: "Which of these best describes person 6’s gender identity?" + + ecstat6: + page_header: "" + check_answer_label: "Person 6’s working situation" + hint_text: "" + question_text: "Which of these best describes person 6’s working situation?" + + details_known_7: + page_header: "You’ve given us the details for 6 people in the household" + check_answer_label: "Details known for person 7" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 7?" + + relat7: + page_header: "" + check_answer_label: "Person 7’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 7’s relationship to the lead tenant?" + + age7: + page_header: "" + age7_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 7’s age?" + age7: + check_answer_label: "Person 7’s age" + hint_text: "" + question_text: "Age" + + sex7: + page_header: "" + check_answer_label: "Person 7’s gender identity" + hint_text: "" + question_text: "Which of these best describes person 7’s gender identity?" + + ecstat7: + page_header: "" + check_answer_label: "Person 7’s working situation" + hint_text: "" + question_text: "Which of these best describes person 7’s working situation?" + + details_known_8: + page_header: "You’ve given us the details for 7 people in the household" + check_answer_label: "Details known for person 8" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 8?" + + relat8: + page_header: "" + check_answer_label: "Person 8’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 8’s relationship to the lead tenant?" + + age8: + page_header: "" + age8_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 8’s age?" + age8: + check_answer_label: "Person 8’s age" + hint_text: "" + question_text: "Age" + + sex8: + page_header: "" + check_answer_label: "Person 8’s gender identity" + hint_text: "" + question_text: "Which of these best describes person 8’s gender identity?" + + ecstat8: + page_header: "" + check_answer_label: "Person 8’s working situation" + hint_text: "" + question_text: "Which of these best describes person 8’s working situation?" \ No newline at end of file diff --git a/config/locales/forms/2024/sales/lettings/household_characteristics.en.yml b/config/locales/forms/2024/sales/lettings/household_characteristics.en.yml new file mode 100644 index 000000000..04a311f06 --- /dev/null +++ b/config/locales/forms/2024/sales/lettings/household_characteristics.en.yml @@ -0,0 +1,322 @@ +en: + forms: + 2024: + lettings: + household_characteristics: + hhmemb: + page_header: "" + check_answer_label: "Number of household members" + hint_text: "You can provide details for a maximum of 8 people." + question_text: "How many people live in the household for this letting?" + + age1: + page_header: "" + age1_known: + check_answer_label: "" + hint_text: "The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same amount of paid work, the lead tenant is whoever is the oldest." + question_text: "Do you know the lead tenant’s age?" + age1: + check_answer_label: "Lead tenant’s age" + hint_text: "" + question_text: "Age" + + sex1: + page_header: "" + check_answer_label: "Lead tenant’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes the lead tenant’s gender identity?" + + ethnic_group: + page_header: "" + check_answer_label: "Lead tenant’s ethnic group" + hint_text: "" + question_text: "What is the lead tenant’s ethnic group?" + + ethnic: + ethnic_background_black: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes lead tenant’s Black, African, Caribbean or Black British background?" + ethnic_background_asian: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes lead tenant’s Asian or Asian British background?" + ethnic_background_arab: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes the lead tenant’s Arab background?" + ethnic_background_mixed: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes lead tenant’s Mixed or Multiple ethnic groups background?" + ethnic_background_white: + page_header: "" + check_answer_label: "Lead tenant’s ethnic background" + hint_text: "" + question_text: "Which of the following best describes lead tenant’s White background?" + + nationality_all: + page_header: "" + nationality_all: + check_answer_label: "Lead tenant’s nationality" + hint_text: "" + question_text: "Enter a nationality" + nationality_all_group: + check_answer_label: "Lead tenant’s nationality" + hint_text: "If the lead tenant is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the tenant should decide which country to enter." + question_text: "What is the nationality of the lead tenant?" + + ecstat1: + page_header: "" + check_answer_label: "Lead tenant’s working situation" + hint_text: "" + question_text: "Which of these best describes the lead tenant’s working situation?" + + details_known_2: + page_header: "You’ve given us the details for 1 person in the household" + check_answer_label: "Details known for person 2" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 2?" + + relat2: + page_header: "" + check_answer_label: "Person 2’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 2’s relationship to the lead tenant?" + + age2: + page_header: "" + age2_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 2’s age?" + age2: + check_answer_label: "Person 2’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex2: + page_header: "" + check_answer_label: "Person 2’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 2’s gender identity?" + + ecstat2: + page_header: "" + check_answer_label: "Person 2’s working situation" + hint_text: "" + question_text: "Which of these best describes person 2’s working situation?" + + details_known_3: + page_header: "You’ve given us the details for 2 people in the household" + check_answer_label: "Details known for person 3" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 3?" + + relat3: + page_header: "" + check_answer_label: "Person 3’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 3’s relationship to the lead tenant?" + + age3: + page_header: "" + age3_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 3’s age?" + age3: + check_answer_label: "Person 3’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex3: + page_header: "" + check_answer_label: "Person 3’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 3’s gender identity?" + + ecstat3: + page_header: "" + check_answer_label: "Person 3’s working situation" + hint_text: "" + question_text: "Which of these best describes person 3’s working situation?" + + details_known_4: + page_header: "You’ve given us the details for 3 people in the household" + check_answer_label: "Details known for person 4" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 4?" + + relat4: + page_header: "" + check_answer_label: "Person 4’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 4’s relationship to the lead tenant?" + + age4: + page_header: "" + age4_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 4’s age?" + age4: + check_answer_label: "Person 4’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex4: + page_header: "" + check_answer_label: "Person 4’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 4’s gender identity?" + + ecstat4: + page_header: "" + check_answer_label: "Person 4’s working situation" + hint_text: "" + question_text: "Which of these best describes person 4’s working situation?" + + details_known_5: + page_header: "You’ve given us the details for 4 people in the household" + check_answer_label: "Details known for person 5" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 5?" + + relat5: + page_header: "" + check_answer_label: "Person 5’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 5’s relationship to the lead tenant?" + + age5: + page_header: "" + age5_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 5’s age?" + age5: + check_answer_label: "Person 5’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex5: + page_header: "" + check_answer_label: "Person 5’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 5’s gender identity?" + + ecstat5: + page_header: "" + check_answer_label: "Person 5’s working situation" + hint_text: "" + question_text: "Which of these best describes person 5’s working situation?" + + details_known_6: + page_header: "You’ve given us the details for 5 people in the household" + check_answer_label: "Details known for person 6" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 6?" + + relat6: + page_header: "" + check_answer_label: "Person 6’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 6’s relationship to the lead tenant?" + + age6: + page_header: "" + age6_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 6’s age?" + age6: + check_answer_label: "Person 6’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex6: + page_header: "" + check_answer_label: "Person 6’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 6’s gender identity?" + + ecstat6: + page_header: "" + check_answer_label: "Person 6’s working situation" + hint_text: "" + question_text: "Which of these best describes person 6’s working situation?" + + details_known_7: + page_header: "You’ve given us the details for 6 people in the household" + check_answer_label: "Details known for person 7" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 7?" + + relat7: + page_header: "" + check_answer_label: "Person 7’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 7’s relationship to the lead tenant?" + + age7: + page_header: "" + age7_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 7’s age?" + age7: + check_answer_label: "Person 7’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex7: + page_header: "" + check_answer_label: "Person 7’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 7’s gender identity?" + + ecstat7: + page_header: "" + check_answer_label: "Person 7’s working situation" + hint_text: "" + question_text: "Which of these best describes person 7’s working situation?" + + details_known_8: + page_header: "You’ve given us the details for 7 people in the household" + check_answer_label: "Details known for person 8" + hint_text: "You must provide details for everyone in the household if you know them." + question_text: "Do you know details for person 8?" + + relat8: + page_header: "" + check_answer_label: "Person 8’s relationship to the lead tenant" + hint_text: "" + question_text: "What is person 8’s relationship to the lead tenant?" + + age8: + page_header: "" + age8_known: + check_answer_label: "" + hint_text: "" + question_text: "Do you know person 8’s age?" + age8: + check_answer_label: "Person 8’s age" + hint_text: "Answer 1 for children aged under 1 year old" + question_text: "Age" + + sex8: + page_header: "" + check_answer_label: "Person 8’s gender identity" + hint_text: "This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth." + question_text: "Which of these best describes person 8’s gender identity?" + + ecstat8: + page_header: "" + check_answer_label: "Person 8’s working situation" + hint_text: "" + question_text: "Which of these best describes person 8’s working situation?" \ No newline at end of file diff --git a/spec/models/form/lettings/pages/person_age_spec.rb b/spec/models/form/lettings/pages/person_age_spec.rb index c9a57c138..dfcc82406 100644 --- a/spec/models/form/lettings/pages/person_age_spec.rb +++ b/spec/models/form/lettings/pages/person_age_spec.rb @@ -1,12 +1,11 @@ require "rails_helper" RSpec.describe Form::Lettings::Pages::PersonAge, type: :model do - subject(:page) { described_class.new(nil, page_definition, subsection, person_index:, person_type:) } + subject(:page) { described_class.new(nil, page_definition, subsection, person_index:) } let(:page_definition) { nil } let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1), start_year_after_2024?: false)) } let(:person_index) { 2 } - let(:person_type) { "non_child" } it "has correct subsection" do expect(page.subsection).to eq(subsection) @@ -21,30 +20,14 @@ RSpec.describe Form::Lettings::Pages::PersonAge, type: :model do expect(page.questions.map(&:id)).to eq(%w[age2_known age2]) end - context "when child" do - let(:person_type) { "child" } - - it "has the correct id" do - expect(page.id).to eq("person_2_age_child") - end - - it "has correct depends_on" do - expect(page.depends_on).to eq( - [{ "details_known_2" => 0, "person_2_child_relation?" => true }], - ) - end + it "has the correct id" do + expect(page.id).to eq("person_2_age") end - context "when not child" do - it "has the correct id" do - expect(page.id).to eq("person_2_age_non_child") - end - - it "has correct depends_on" do - expect(page.depends_on).to eq( - [{ "details_known_2" => 0, "person_2_child_relation?" => false }], - ) - end + it "has correct depends_on" do + expect(page.depends_on).to eq( + [{ "details_known_2" => 0 }], + ) end end @@ -56,12 +39,12 @@ RSpec.describe Form::Lettings::Pages::PersonAge, type: :model do end it "has the correct id" do - expect(page.id).to eq("person_3_age_non_child") + expect(page.id).to eq("person_3_age") end it "has correct depends_on" do expect(page.depends_on).to eq( - [{ "details_known_3" => 0, "person_3_child_relation?" => false }], + [{ "details_known_3" => 0 }], ) end end diff --git a/spec/models/form/lettings/questions/age_spec.rb b/spec/models/form/lettings/questions/age_spec.rb index 4ec1ee985..e456007f7 100644 --- a/spec/models/form/lettings/questions/age_spec.rb +++ b/spec/models/form/lettings/questions/age_spec.rb @@ -1,12 +1,11 @@ require "rails_helper" RSpec.describe Form::Lettings::Questions::Age, type: :model do - subject(:question) { described_class.new(nil, question_definition, page, person_index:, person_type:) } + subject(:question) { described_class.new(nil, question_definition, page, person_index:) } let(:question_definition) { nil } let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 4), start_year_after_2024?: false))) } let(:person_index) { 2 } - let(:person_type) { "non_child" } it "has correct page" do expect(question.page).to eq(page) diff --git a/spec/models/form/lettings/subsections/household_characteristics_spec.rb b/spec/models/form/lettings/subsections/household_characteristics_spec.rb index c71ee165c..e199f55d3 100644 --- a/spec/models/form/lettings/subsections/household_characteristics_spec.rb +++ b/spec/models/form/lettings/subsections/household_characteristics_spec.rb @@ -49,8 +49,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod working_situation_lead_tenant_over_retirement_value_check person_2_known person_2_relationship_to_lead - person_2_age_child - person_2_age_non_child + person_2_age no_females_pregnant_household_person_2_age_value_check females_in_soft_age_range_in_pregnant_household_person_2_age_value_check age_2_under_retirement_value_check @@ -64,8 +63,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod working_situation_2_over_retirement_value_check person_3_known person_3_relationship_to_lead - person_3_age_child - person_3_age_non_child + person_3_age no_females_pregnant_household_person_3_age_value_check females_in_soft_age_range_in_pregnant_household_person_3_age_value_check age_3_under_retirement_value_check @@ -79,8 +77,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod working_situation_3_over_retirement_value_check person_4_known person_4_relationship_to_lead - person_4_age_child - person_4_age_non_child + person_4_age no_females_pregnant_household_person_4_age_value_check females_in_soft_age_range_in_pregnant_household_person_4_age_value_check age_4_under_retirement_value_check @@ -94,8 +91,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod working_situation_4_over_retirement_value_check person_5_known person_5_relationship_to_lead - person_5_age_child - person_5_age_non_child + person_5_age no_females_pregnant_household_person_5_age_value_check females_in_soft_age_range_in_pregnant_household_person_5_age_value_check age_5_under_retirement_value_check @@ -109,8 +105,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod working_situation_5_over_retirement_value_check person_6_known person_6_relationship_to_lead - person_6_age_child - person_6_age_non_child + person_6_age no_females_pregnant_household_person_6_age_value_check females_in_soft_age_range_in_pregnant_household_person_6_age_value_check age_6_under_retirement_value_check @@ -124,8 +119,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod working_situation_6_over_retirement_value_check person_7_known person_7_relationship_to_lead - person_7_age_child - person_7_age_non_child + person_7_age no_females_pregnant_household_person_7_age_value_check females_in_soft_age_range_in_pregnant_household_person_7_age_value_check age_7_under_retirement_value_check @@ -139,8 +133,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod working_situation_7_over_retirement_value_check person_8_known person_8_relationship_to_lead - person_8_age_child - person_8_age_non_child + person_8_age no_females_pregnant_household_person_8_age_value_check females_in_soft_age_range_in_pregnant_household_person_8_age_value_check age_8_under_retirement_value_check @@ -191,8 +184,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_2_relationship_to_lead relationship_2_partner_under_16_value_check relationship_2_multiple_partners_value_check - person_2_age_child - person_2_age_non_child + person_2_age no_females_pregnant_household_person_2_age_value_check females_in_soft_age_range_in_pregnant_household_person_2_age_value_check age_2_under_retirement_value_check @@ -209,8 +201,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_3_relationship_to_lead relationship_3_partner_under_16_value_check relationship_3_multiple_partners_value_check - person_3_age_child - person_3_age_non_child + person_3_age no_females_pregnant_household_person_3_age_value_check females_in_soft_age_range_in_pregnant_household_person_3_age_value_check age_3_under_retirement_value_check @@ -227,8 +218,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_4_relationship_to_lead relationship_4_partner_under_16_value_check relationship_4_multiple_partners_value_check - person_4_age_child - person_4_age_non_child + person_4_age no_females_pregnant_household_person_4_age_value_check females_in_soft_age_range_in_pregnant_household_person_4_age_value_check age_4_under_retirement_value_check @@ -245,8 +235,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_5_relationship_to_lead relationship_5_partner_under_16_value_check relationship_5_multiple_partners_value_check - person_5_age_child - person_5_age_non_child + person_5_age no_females_pregnant_household_person_5_age_value_check females_in_soft_age_range_in_pregnant_household_person_5_age_value_check age_5_under_retirement_value_check @@ -263,8 +252,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_6_relationship_to_lead relationship_6_partner_under_16_value_check relationship_6_multiple_partners_value_check - person_6_age_child - person_6_age_non_child + person_6_age no_females_pregnant_household_person_6_age_value_check females_in_soft_age_range_in_pregnant_household_person_6_age_value_check age_6_under_retirement_value_check @@ -281,8 +269,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_7_relationship_to_lead relationship_7_partner_under_16_value_check relationship_7_multiple_partners_value_check - person_7_age_child - person_7_age_non_child + person_7_age no_females_pregnant_household_person_7_age_value_check females_in_soft_age_range_in_pregnant_household_person_7_age_value_check age_7_under_retirement_value_check @@ -299,8 +286,7 @@ RSpec.describe Form::Lettings::Subsections::HouseholdCharacteristics, type: :mod person_8_relationship_to_lead relationship_8_partner_under_16_value_check relationship_8_multiple_partners_value_check - person_8_age_child - person_8_age_non_child + person_8_age no_females_pregnant_household_person_8_age_value_check females_in_soft_age_range_in_pregnant_household_person_8_age_value_check age_8_under_retirement_value_check