Browse Source

feat: lint code

pull/982/head
Sam Seed 3 years ago
parent
commit
0b7df1126b
  1. 2
      app/models/validations/property_validations.rb
  2. 2
      spec/models/validations/property_validations_spec.rb

2
app/models/validations/property_validations.rb

@ -39,7 +39,7 @@ module Validations::PropertyValidations
record.errors.add :referral, I18n.t("validations.household.referral.rsnvac_non_temp") record.errors.add :referral, I18n.t("validations.household.referral.rsnvac_non_temp")
end end
if record.renewal == 0 && record.rsnvac == 14 if record.renewal && record.renewal.zero? && record.rsnvac == 14
record.errors.add :rsnvac, I18n.t("validations.property.rsnvac.not_a_renewal") record.errors.add :rsnvac, I18n.t("validations.property.rsnvac.not_a_renewal")
end end
end end

2
spec/models/validations/property_validations_spec.rb

@ -236,7 +236,7 @@ RSpec.describe Validations::PropertyValidations do
context "when the letting is not a renewal" do context "when the letting is not a renewal" do
it "validates that the reason for vacancy is not renewal" do it "validates that the reason for vacancy is not renewal" do
record.first_time_property_let_as_social_housing = 0 record.first_time_property_let_as_social_housing = 0
record.renewal = 0 record.renewal = 0
record.rsnvac = 14 record.rsnvac = 14
property_validator.validate_rsnvac(record) property_validator.validate_rsnvac(record)

Loading…
Cancel
Save