Browse Source

Change the numbering for the rest of homeless methods (#342)

pull/343/head
kosiakkatrina 3 years ago committed by GitHub
parent
commit
87143fe13a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/models/case_log.rb
  2. 4
      spec/models/validations/household_validations_spec.rb

4
app/models/case_log.rb

@ -200,11 +200,11 @@ class CaseLog < ApplicationRecord
end end
def is_assessed_homeless? def is_assessed_homeless?
!!(homeless && homeless.zero?) homeless == 11
end end
def is_other_homeless? def is_other_homeless?
homeless == 1 homeless == 7
end end
def is_not_homeless? def is_not_homeless?

4
spec/models/validations/household_validations_spec.rb

@ -498,7 +498,7 @@ RSpec.describe Validations::HouseholdValidations do
context "when homelessness is assessed" do context "when homelessness is assessed" do
it "cannot be internal transfer" do it "cannot be internal transfer" do
record.homeless = 0 record.homeless = 11
record.referral = 1 record.referral = 1
household_validator.validate_referral(record) household_validator.validate_referral(record)
expect(record.errors["referral"]) expect(record.errors["referral"])
@ -519,7 +519,7 @@ RSpec.describe Validations::HouseholdValidations do
context "when homelessness is other" do context "when homelessness is other" do
it "cannot be internal transfer" do it "cannot be internal transfer" do
record.referral = 1 record.referral = 1
record.homeless = 1 record.homeless = 7
household_validator.validate_referral(record) household_validator.validate_referral(record)
expect(record.errors["referral"]) expect(record.errors["referral"])
.to include(match I18n.t("validations.household.referral.other_homeless")) .to include(match I18n.t("validations.household.referral.other_homeless"))

Loading…
Cancel
Save