From 87143fe13a2853dd0cc038f9f0c6d1d658c21223 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Mon, 28 Feb 2022 16:23:51 +0000 Subject: [PATCH] Change the numbering for the rest of homeless methods (#342) --- app/models/case_log.rb | 4 ++-- spec/models/validations/household_validations_spec.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/case_log.rb b/app/models/case_log.rb index 3a838f86a..ec41634a0 100644 --- a/app/models/case_log.rb +++ b/app/models/case_log.rb @@ -200,11 +200,11 @@ class CaseLog < ApplicationRecord end def is_assessed_homeless? - !!(homeless && homeless.zero?) + homeless == 11 end def is_other_homeless? - homeless == 1 + homeless == 7 end def is_not_homeless? diff --git a/spec/models/validations/household_validations_spec.rb b/spec/models/validations/household_validations_spec.rb index 3dac48834..88b54832d 100644 --- a/spec/models/validations/household_validations_spec.rb +++ b/spec/models/validations/household_validations_spec.rb @@ -498,7 +498,7 @@ RSpec.describe Validations::HouseholdValidations do context "when homelessness is assessed" do it "cannot be internal transfer" do - record.homeless = 0 + record.homeless = 11 record.referral = 1 household_validator.validate_referral(record) expect(record.errors["referral"]) @@ -519,7 +519,7 @@ RSpec.describe Validations::HouseholdValidations do context "when homelessness is other" do it "cannot be internal transfer" do record.referral = 1 - record.homeless = 1 + record.homeless = 7 household_validator.validate_referral(record) expect(record.errors["referral"]) .to include(match I18n.t("validations.household.referral.other_homeless"))