child_over_16:"Answer cannot be over 16 as person’s %{person_num} working situation is ‘child under 16‘"
child_over_16:"Answer cannot be over 16 as person’s %{person_num} working situation is ‘child under 16‘"
child_over_20:"Answer cannot be 20 or over as the relationship is ‘child’"
child_over_20:"Answer cannot be 20 or over as the relationship is ‘child’"
child_12_years_younger:"A child must be at least 12 years younger than their parent"
child_12_years_younger:"A child must be at least 12 years younger than their parent"
child_12_years_younger_2024:"Age must be at least 12 years younger than the %{person} as person %{person_num}'s relationship to %{person} is child."
age1_child_12_years_younger_2024:"Age must be at least 12 years older than person %{person_num}'s age as person %{person_num}'s relationship to %{person} is child."
not_student_16_19:"Answer cannot be between 16 and 19 as person %{person_num} is a child of the lead tenant but is not a full-time student"
not_student_16_19:"Answer cannot be between 16 and 19 as person %{person_num} is a child of the lead tenant but is not a full-time student"
student_16_19:
student_16_19:
cannot_be_16_19:
cannot_be_16_19:
child_not_student:"Person cannot be aged 16-19 if they have relationship ‘child’ but are not a student"
child_not_student:"Person cannot be aged 16-19 if they have relationship ‘child’ but are not a student"
must_be_16_19:"Person must be aged 16-19 if they are a student and have relationship ‘child’"
must_be_16_19:"Person must be aged 16-19 if they are a student and have relationship ‘child’"
must_be_16_19_2024:"Person %{person_num}'s age must be 16-19 as their working situation is student and their relationship to the %{person} is child"
lead:
lead:
over_25:"The lead tenant must be under 26 as you told us their housing situation immediately before this letting was a children’s home or foster care"
over_25:"The lead tenant must be under 26 as you told us their housing situation immediately before this letting was a children’s home or foster care"
child_over_19_relat:"Age must be 19 or under as you told us person 2's relationship to the %{person} is child"
student_not_child:
student_not_child:
cannot_be_16_19:"Person cannot be aged 16-19 if they are a student but not a child"
cannot_be_16_19:"Person cannot be aged 16-19 if they are a student but not a child"
ecstat:
ecstat:
@ -485,7 +481,6 @@ en:
cannot_be_student:
cannot_be_student:
child_not_16_19:"Person cannot be a student if they are not aged 16-19 but have relationship ‘child’"
child_not_16_19:"Person cannot be a student if they are not aged 16-19 but have relationship ‘child’"
must_be_student:"Person must be a student if they are aged 16-19 and have relationship ‘child’"
must_be_student:"Person must be a student if they are aged 16-19 and have relationship ‘child’"
must_be_student_2024:"Person %{person_num}'s working situation must be student or prefers not to say, as their age is 16-19 and their relationship to the %{person} is child"
retired_male:"Answer cannot be ‘retired’ as the male tenant is under 65"
retired_male:"Answer cannot be ‘retired’ as the male tenant is under 65"
retired_female:"Answer cannot be ‘retired’ as the female tenant is under 60"
retired_female:"Answer cannot be ‘retired’ as the female tenant is under 60"
not_child_16_19:
not_child_16_19:
@ -500,9 +495,7 @@ en:
cannot_be_child:
cannot_be_child:
student_not_16_19:"Answer cannot be ‘child’ if the person is a student but not aged 16-19"
student_not_16_19:"Answer cannot be ‘child’ if the person is a student but not aged 16-19"
16_19_not_student:"Answer cannot be ‘child’ if the person is aged 16-19 but not a student"
16_19_not_student:"Answer cannot be ‘child’ if the person is aged 16-19 but not a student"
must_be_child_2024:"Person %{person_num}'s relationship to the %{person} must be child as their working situation is student and their age is 16-19"
child_over_19:"Answer cannot be child as you told us person %{person_num} is over 19"
child_over_19:"Answer cannot be child as you told us person %{person_num} is over 19"
child_12_years_younger_2024:"Relationship cannot be child, as person %{person_num} is less than 12 years younger than the %{person}"
buyer_is_a_child:"Relationship cannot be child, as this person is a buyer"
buyer_is_a_child:"Relationship cannot be child, as this person is a buyer"
housingneeds_a:
housingneeds_a:
one_or_two_choices:"You can only select one option or ‘other disabled access needs’ plus ‘wheelchair-accessible housing’, ‘wheelchair access to essential rooms’ or ‘level access housing’"
one_or_two_choices:"You can only select one option or ‘other disabled access needs’ plus ‘wheelchair-accessible housing’, ‘wheelchair access to essential rooms’ or ‘level access housing’"
.not_toinclude("Person 2's working situation must be student or prefers not to say, as their age is 16-19 and their relationship to the lead tenant is child")
end
end
end
context"with 2024 logs"do
context"with 2024 logs"do
@ -560,37 +547,17 @@ RSpec.describe Validations::HouseholdValidations do
end
end
context"when the household contains a tenant’s child between the ages of 16 and 19"do
context"when the household contains a tenant’s child between the ages of 16 and 19"do
it"validates that person's economic status must be full time student or refused"do
.toinclude("Person 2's working situation must be student or prefers not to say, as their age is 16-19 and their relationship to the lead tenant is child")
.tobe_empty
expect(record.errors["age2"])
expect(record.errors["age2"])
.toinclude("Person cannot be aged 16-19 if they have relationship ‘child’ but are not a student")
.tobe_empty
expect(record.errors["relat2"])
expect(record.errors["relat2"])
.toinclude("Answer cannot be ‘child’ if the person is aged 16-19 but not a student")
.tobe_empty
end
it"expects that person can be a full time student"do