Browse Source

feat: update copy

CLDC-1790-sales-validation-content-updates
natdeanlewissoftwire 2 years ago
parent
commit
2c01612937
  1. 2
      app/models/validations/sales/sale_information_validations.rb
  2. 2
      config/locales/en.yml
  3. 2
      spec/models/validations/sales/sale_information_validations_spec.rb

2
app/models/validations/sales/sale_information_validations.rb

@ -35,7 +35,7 @@ module Validations::Sales::SaleInformationValidations
if record.frombeds != 1 && record.fromprop == 2 if record.frombeds != 1 && record.fromprop == 2
record.errors.add :frombeds, I18n.t("validations.sale_information.previous_property_beds.property_type_bedsit") record.errors.add :frombeds, I18n.t("validations.sale_information.previous_property_beds.property_type_bedsit")
record.errors.add :fromprop, I18n.t("validations.sale_information.previous_property_type.property_type_bedsit") record.errors.add :fromprop, I18n.t("validations.sale_information.previous_property_beds.property_type_bedsit")
end end
end end

2
config/locales/en.yml

@ -424,7 +424,7 @@ en:
must_be_less_than_1_year_from_saledate: must_be_less_than_1_year_from_saledate:
Contract exchange date must be less than 1 year before completion date Contract exchange date must be less than 1 year before completion date
previous_property_beds: previous_property_beds:
property_type_bedsit: "Bedsit bedroom maximum 1" property_type_bedsit: "A bedsit cannot have more than 1 bedroom"
discounted_ownership_value: "Mortgage, deposit, and grant total must equal £%{value_with_discount}" discounted_ownership_value: "Mortgage, deposit, and grant total must equal £%{value_with_discount}"
soft_validations: soft_validations:

2
spec/models/validations/sales/sale_information_validations_spec.rb

@ -159,7 +159,7 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
it "does add an error if it's a bedsit" do it "does add an error if it's a bedsit" do
sale_information_validator.validate_previous_property_unit_type(record) sale_information_validator.validate_previous_property_unit_type(record)
expect(record.errors["fromprop"]).to include(I18n.t("validations.sale_information.previous_property_type.property_type_bedsit")) expect(record.errors["fromprop"]).to include(I18n.t("validations.sale_information.previous_property_beds.property_type_bedsit"))
expect(record.errors["frombeds"]).to include(I18n.t("validations.sale_information.previous_property_beds.property_type_bedsit")) expect(record.errors["frombeds"]).to include(I18n.t("validations.sale_information.previous_property_beds.property_type_bedsit"))
end end
end end

Loading…
Cancel
Save