diff --git a/app/models/validations/financial_validations.rb b/app/models/validations/financial_validations.rb index 4dec7bb78..b1bddd9cb 100644 --- a/app/models/validations/financial_validations.rb +++ b/app/models/validations/financial_validations.rb @@ -110,6 +110,7 @@ module Validations::FinancialValidations if record.is_carehome? period = record.form.get_question("period", record).label_from_value(record.period).downcase if record.chcharge.blank? + record.errors.add :is_carehome, I18n.t("validations.financial.carehome.not_provided", period:) record.errors.add :chcharge, I18n.t("validations.financial.carehome.not_provided", period:) elsif !weekly_value_in_range(record, "chcharge", 10, 1000) max_chcharge = record.weekly_to_value_per_period(1000) diff --git a/spec/models/validations/financial_validations_spec.rb b/spec/models/validations/financial_validations_spec.rb index c4c4958db..0676e900b 100644 --- a/spec/models/validations/financial_validations_spec.rb +++ b/spec/models/validations/financial_validations_spec.rb @@ -1010,6 +1010,8 @@ RSpec.describe Validations::FinancialValidations do financial_validator.validate_care_home_charges(record) expect(record.errors["chcharge"]) .to include(match I18n.t("validations.financial.carehome.not_provided", period: "every 4 weeks")) + expect(record.errors["is_carehome"]) + .to include(match I18n.t("validations.financial.carehome.not_provided", period: "every 4 weeks")) end end