From 2383bc99c31b3d129468c3f97b5e7606cd62f857 Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Fri, 26 Jul 2024 16:39:14 +0100 Subject: [PATCH] Add test for :skip_bu_error --- .../bulk_upload/lettings/year2024/row_parser_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 fbff000fd..89ab07e79 100644 --- a/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb @@ -750,6 +750,18 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do expect(parser.errors[:field_15]).to eq(["You must answer tenant has seen the privacy notice"]) end end + + context "when there is a :skip_bu_error error" do + let(:managing_org) { create(:organisation, :with_old_visible_id, rent_periods: [4, 1]) } + let(:attributes) { valid_attributes.merge({ field_123: 3, field_128: 80 }) } + + it "does not add that error" do + parser.valid? + + expect(parser.log.errors.map(&:attribute).sort).to eql(%i[managing_organisation period]) + expect(parser.errors.map(&:attribute)).to eql(%i[field_123]) + end + end end describe "#validate_nulls" do