ifage>=16&&age<=19&&relationship=="Child - includes young adult and grown-up"&&(economic_status!="Full-time student"||economic_status!="Prefer not to say")
ifage>=16&&age<=19&&relationship=="Child - includes young adult and grown-up"&&(economic_status!="Full-time student"||economic_status!="Prefer not to say")
record.errors.add"person_#{person_num}_economic_status","If age is between 16 and 19 - tenant #{person_num} must be a full time student or prefer not to say."
record.errors.add"ecstat#{person_num}","If age is between 16 and 19 - tenant #{person_num} must be a full time student or prefer not to say."
it"validate that persons aged under 16 must be a child (economically speaking)"do
it"validate that persons aged under 16 must be a child (economically speaking)"do
expect{CaseLog.create!(person_2_age:15,person_2_economic_status:"Full-time - 30 hours or more")}.toraise_error(ActiveRecord::RecordInvalid)
expect{CaseLog.create!(age2:15,ecstat2:"Full-time - 30 hours or more")}.toraise_error(ActiveRecord::RecordInvalid)
end
end
it"validate that persons aged between 16 and 19 that are a child must be a full time student or economic status refused"do
it"validate that persons aged between 16 and 19 that are a child must be a full time student or economic status refused"do
expect{CaseLog.create!(person_2_age:17,person_2_relationship:"Child - includes young adult and grown-up",person_2_economic_status:"Full-time - 30 hours or more")}.toraise_error(ActiveRecord::RecordInvalid)
expect{CaseLog.create!(age2:17,relat2:"Child - includes young adult and grown-up",ecstat2:"Full-time - 30 hours or more")}.toraise_error(ActiveRecord::RecordInvalid)
end
end
it"validate that persons aged under 16 must be a child relationship"do
it"validate that persons aged under 16 must be a child relationship"do