diff --git a/app/models/validations/household_validations.rb b/app/models/validations/household_validations.rb index 6dff1ac12..5b3d7c4d1 100644 --- a/app/models/validations/household_validations.rb +++ b/app/models/validations/household_validations.rb @@ -7,7 +7,7 @@ module Validations::HouseholdValidations def validate_reasonable_preference(record) if record.homeless == "No" && record.reasonpref == "Yes" record.errors.add :reasonpref, I18n.t("validations.household.reasonpref.not_homeless") - record.errors.add :homeless, I18n.t("validations.household.reasonpref.not_homeless") + record.errors.add :homeless, I18n.t("validations.household.homeless.reasonpref.not_homeless") elsif record.reasonpref == "No" if [record.rp_homeless, record.rp_insan_unsat, record.rp_medwel, record.rp_hardship, record.rp_dontknow].any? { |a| a == "Yes" } record.errors.add :reasonable_preference_reason, I18n.t("validations.household.reasonable_preference_reason.reason_not_required") diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index 09105a4ff..95f9ec429 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -2135,7 +2135,7 @@ "depends_on": [{ "renewal": "No" }] }, "reason_for_leaving_last_settled_home": { - "header": "Leaving their last settled home", + "header": "", "description": "", "questions": { "reason": { @@ -2263,7 +2263,7 @@ "depends_on": [{ "renewal": "No" }] }, "reason_for_leaving_last_settled_home_renewal": { - "header": "Leaving their last settled home", + "header": "", "description": "", "questions": { "reason": { @@ -2922,13 +2922,13 @@ } }, "reasonable_preference_reason": { - "header": "Reason for reasonable preference being given", + "header": "", "description": "", "questions": { "reasonable_preference_reason": { "check_answer_label": "Reason for reasonable preference", "header": "Why was the household given ‘reasonable preference’?", - "hint_text": "", + "hint_text": "Select all that apply", "type": "checkbox", "answer_options": { "rp_homeless": { diff --git a/config/locales/en.yml b/config/locales/en.yml index b18747985..c67daa54b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -121,6 +121,8 @@ en: internal_transfer: "Answer cannot be assessed as homeless as you already told us this tenancy is an internal transfer" other: internal_transfer: "Answer cannot be other homelessness as you already told us this tenancy was an internal transfer" + reasonpref: + not_homeless: "Can not be No if household was given reasonable preference" tenancy: diff --git a/spec/models/validations/household_validations_spec.rb b/spec/models/validations/household_validations_spec.rb index 6d588ff4f..801fea796 100644 --- a/spec/models/validations/household_validations_spec.rb +++ b/spec/models/validations/household_validations_spec.rb @@ -72,7 +72,7 @@ RSpec.describe Validations::HouseholdValidations do expect(record.errors["reasonpref"]) .to include(match I18n.t("validations.household.reasonpref.not_homeless")) expect(record.errors["homeless"]) - .to include(match I18n.t("validations.household.reasonpref.not_homeless")) + .to include(match I18n.t("validations.household.homeless.reasonpref.not_homeless")) end end