Browse Source

remove validation that male cannot have been in refuge

pull/2383/head
Arthur Campbell 2 years ago
parent
commit
cc43048fa0
  1. 5
      app/models/validations/household_validations.rb
  2. 12
      spec/models/validations/household_validations_spec.rb

5
app/models/validations/household_validations.rb

@ -145,11 +145,6 @@ module Validations::HouseholdValidations
record.errors.add :age1, I18n.t("validations.household.age.lead.over_25") record.errors.add :age1, I18n.t("validations.household.age.lead.over_25")
end end
if record.sex1 == "M" && record.previous_tenancy_was_refuge?
record.errors.add :prevten, I18n.t("validations.household.prevten.male_refuge")
record.errors.add :sex1, I18n.t("validations.household.gender.male_refuge")
end
# 3 Private Sector Tenancy # 3 Private Sector Tenancy
# 4 Tied housing or rented with job # 4 Tied housing or rented with job
# 7 Direct access hostel # 7 Direct access hostel

12
spec/models/validations/household_validations_spec.rb

@ -777,18 +777,6 @@ RSpec.describe Validations::HouseholdValidations do
end end
end end
context "when the lead tenant is male" do
it "cannot be refuge" do
record.prevten = 21
record.sex1 = "M"
household_validator.validate_previous_housing_situation(record)
expect(record.errors["prevten"])
.to include(match I18n.t("validations.household.prevten.male_refuge"))
expect(record.errors["sex1"])
.to include(match I18n.t("validations.household.gender.male_refuge"))
end
end
context "when the referral is internal transfer" do context "when the referral is internal transfer" do
it "prevten can be 9" do it "prevten can be 9" do
record.referral = 1 record.referral = 1

Loading…
Cancel
Save