Browse Source

Update privacy notice BU validation (#2377)

pull/2383/head
kosiakkatrina 8 months ago committed by GitHub
parent
commit
a0842064fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      app/services/bulk_upload/lettings/year2023/row_parser.rb
  2. 8
      spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb
  3. 8
      spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb

2
app/services/bulk_upload/lettings/year2023/row_parser.rb

@ -517,7 +517,7 @@ private
def validate_declaration_acceptance def validate_declaration_acceptance
unless field_45 == 1 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
end end

8
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 expect(parser).not_to be_valid
end end
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 end
describe "#validate_nulls" do describe "#validate_nulls" do

8
spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb

@ -787,6 +787,14 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
end end
end 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 end
describe "#validate_nulls" do describe "#validate_nulls" do

Loading…
Cancel
Save