Browse Source

feat: update tests

pull/1924/head
natdeanlewissoftwire 3 years ago
parent
commit
c897e36981
  1. 18
      spec/models/validations/household_validations_spec.rb

18
spec/models/validations/household_validations_spec.rb

@ -619,27 +619,27 @@ RSpec.describe Validations::HouseholdValidations do
end end
context "when the referral is internal transfer" do context "when the referral is internal transfer" do
it "cannot be 3" do it "prevten can be 9" do
record.referral = 1 record.referral = 1
record.prevten = 3 record.prevten = 9
household_validator.validate_previous_housing_situation(record) household_validator.validate_previous_housing_situation(record)
expect(record.errors["prevten"]) expect(record.errors["prevten"])
.to include(match I18n.t("validations.household.prevten.internal_transfer", prevten: "")) .to be_empty
expect(record.errors["referral"]) expect(record.errors["referral"])
.to include(match I18n.t("validations.household.referral.prevten_invalid", prevten: "")) .to be_empty
end end
it "can be 9" do it "prevten cannot be 3" do
record.referral = 1 record.referral = 1
record.prevten = 9 record.prevten = 3
household_validator.validate_previous_housing_situation(record) household_validator.validate_previous_housing_situation(record)
expect(record.errors["prevten"]) expect(record.errors["prevten"])
.to be_empty .to include(match I18n.t("validations.household.prevten.internal_transfer", prevten: ""))
expect(record.errors["referral"]) expect(record.errors["referral"])
.to be_empty .to include(match I18n.t("validations.household.referral.prevten_invalid", prevten: ""))
end end
it "cannot be 4, 10, 13, 19, 23, 24, 25, 26, 28, 29" do it "prevten cannot be 4, 10, 13, 19, 23, 24, 25, 26, 28, 29" do
record.referral = 1 record.referral = 1
record.prevten = 4 record.prevten = 4
household_validator.validate_previous_housing_situation(record) household_validator.validate_previous_housing_situation(record)

Loading…
Cancel
Save