diff --git a/app/services/bulk_upload/lettings/year2023/row_parser.rb b/app/services/bulk_upload/lettings/year2023/row_parser.rb index 85d660bd5..7ce80b279 100644 --- a/app/services/bulk_upload/lettings/year2023/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2023/row_parser.rb @@ -517,7 +517,7 @@ private def validate_declaration_acceptance unless field_45 == 1 - errors.add(:field_45, I18n.t("validations.declaration.missing"), category: :setup) + errors.add(:field_45, I18n.t("validations.declaration.missing.pre_2024"), category: :setup) end end diff --git a/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb b/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb index 6203b9c59..6b3652b6f 100644 --- a/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb @@ -692,6 +692,14 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do expect(parser).not_to be_valid end end + + context "when the privacy notice is not accepted" do + let(:attributes) { valid_attributes.merge({ field_45: nil }) } + + it "cannot be nulled" do + expect(parser.errors[:field_45]).to eq(["You must show the DLUHC privacy notice to the tenant before you can submit this log."]) + end + end end describe "#validate_nulls" do diff --git a/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb b/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb index d1c2fc761..7895b8eb5 100644 --- a/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb @@ -787,6 +787,14 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do end end end + + context "when the privacy notice is not accepted" do + let(:attributes) { valid_attributes.merge({ field_15: nil }) } + + it "cannot be nulled" do + expect(parser.errors[:field_15]).to eq(["You must answer tenant has seen the privacy notice"]) + end + end end describe "#validate_nulls" do