diff --git a/app/services/bulk_upload/lettings/row_parser.rb b/app/services/bulk_upload/lettings/row_parser.rb index dcba8be28..085a3662f 100644 --- a/app/services/bulk_upload/lettings/row_parser.rb +++ b/app/services/bulk_upload/lettings/row_parser.rb @@ -776,6 +776,8 @@ private case rsnvac when 15, 16, 17 1 + else + 0 end end diff --git a/spec/services/bulk_upload/lettings/row_parser_spec.rb b/spec/services/bulk_upload/lettings/row_parser_spec.rb index 7a09ba4b8..dabc8d1ab 100644 --- a/spec/services/bulk_upload/lettings/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/row_parser_spec.rb @@ -186,6 +186,12 @@ RSpec.describe BulkUpload::Lettings::RowParser do field_80: "1234.56", field_87: "1", field_88: "234.56", + + field_106: "15", + field_99: "0", + field_89: now.day.to_s, + field_90: now.month.to_s, + field_91: now.strftime("%g"), } end @@ -1154,6 +1160,14 @@ RSpec.describe BulkUpload::Lettings::RowParser do expect(parser.log.first_time_property_let_as_social_housing).to eq(1) end end + + context "when field_106 is not 15, 16, or 17" do + let(:attributes) { { bulk_upload:, field_106: "1" } } + + it "sets to 0" do + expect(parser.log.first_time_property_let_as_social_housing).to eq(0) + end + end end describe "#housingneeds" do