Browse Source

CLDC-2447 Bulk upload 23-24 lettings net income known bug (#1695)

* feat: fix bug

* feat: update tests

* feat: test ALL possibilities
pull/1708/head
natdeanlewissoftwire 2 years ago committed by GitHub
parent
commit
7bfe3f4d75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/services/bulk_upload/lettings/year2023/row_parser.rb
  2. 26
      spec/services/bulk_upload/lettings/year2022/row_parser_spec.rb
  3. 18
      spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb

2
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

26
spec/services/bulk_upload/lettings/year2022/row_parser_spec.rb

@ -1295,6 +1295,7 @@ RSpec.describe BulkUpload::Lettings::Year2022::RowParser do
end
describe "#net_income_known" do
context "when 1" do
let(:attributes) { { bulk_upload:, field_51: "1" } }
it "sets value from correct mapping" do
@ -1302,6 +1303,31 @@ RSpec.describe BulkUpload::Lettings::Year2022::RowParser do
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
describe "#unitletas" do
let(:attributes) { { bulk_upload:, field_105: "1" } }

18
spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb

@ -1365,6 +1365,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
end
describe "#net_income_known" do
context "when 1" do
let(:attributes) { { bulk_upload:, field_120: "1" } }
it "sets value from correct mapping" do
@ -1372,6 +1373,23 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
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
describe "#unitletas" do
let(:attributes) { { bulk_upload:, field_26: "1" } }

Loading…
Cancel
Save