diff --git a/app/services/bulk_upload/lettings/year2023/row_parser.rb b/app/services/bulk_upload/lettings/year2023/row_parser.rb index 225c45b4f..0912b02e4 100644 --- a/app/services/bulk_upload/lettings/year2023/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2023/row_parser.rb @@ -1442,8 +1442,6 @@ private when 2 1 when 3 - 1 - when 4 2 end end diff --git a/spec/services/bulk_upload/lettings/year2022/row_parser_spec.rb b/spec/services/bulk_upload/lettings/year2022/row_parser_spec.rb index 05120713d..365771bb6 100644 --- a/spec/services/bulk_upload/lettings/year2022/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2022/row_parser_spec.rb @@ -1295,10 +1295,36 @@ RSpec.describe BulkUpload::Lettings::Year2022::RowParser do end describe "#net_income_known" do - let(:attributes) { { bulk_upload:, field_51: "1" } } + context "when 1" do + let(:attributes) { { bulk_upload:, field_51: "1" } } - it "sets value from correct mapping" do - expect(parser.log.net_income_known).to eq(0) + it "sets value from correct mapping" do + expect(parser.log.net_income_known).to eq(0) + end + end + + context "when 2" do + let(:attributes) { { bulk_upload:, field_51: "2" } } + + it "sets value from correct mapping" do + expect(parser.log.net_income_known).to eq(1) + end + end + + context "when 3" do + let(:attributes) { { bulk_upload:, field_51: "3" } } + + it "sets value from correct mapping" do + expect(parser.log.net_income_known).to eq(1) + end + end + + context "when 4" do + let(:attributes) { { bulk_upload:, field_51: "4" } } + + it "sets value from correct mapping" do + expect(parser.log.net_income_known).to eq(2) + end 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 8586a470c..5bb6e8958 100644 --- a/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb @@ -1365,10 +1365,28 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do end describe "#net_income_known" do - let(:attributes) { { bulk_upload:, field_120: "1" } } + context "when 1" do + let(:attributes) { { bulk_upload:, field_120: "1" } } - it "sets value from correct mapping" do - expect(parser.log.net_income_known).to eq(0) + it "sets value from correct mapping" do + expect(parser.log.net_income_known).to eq(0) + end + end + + context "when 2" do + let(:attributes) { { bulk_upload:, field_120: "2" } } + + it "sets value from correct mapping" do + expect(parser.log.net_income_known).to eq(1) + end + end + + context "when 3" do + let(:attributes) { { bulk_upload:, field_120: "3" } } + + it "sets value from correct mapping" do + expect(parser.log.net_income_known).to eq(2) + end end end