diff --git a/app/services/bulk_upload/sales/year2023/row_parser.rb b/app/services/bulk_upload/sales/year2023/row_parser.rb index 93f15395f..5ea5af787 100644 --- a/app/services/bulk_upload/sales/year2023/row_parser.rb +++ b/app/services/bulk_upload/sales/year2023/row_parser.rb @@ -791,7 +791,7 @@ private attributes["purchid"] = purchaser_code attributes["saledate"] = saledate - attributes["noint"] = 2 if field_28 == 1 + attributes["noint"] = field_28 attributes["age1_known"] = age1_known? attributes["age1"] = field_30 if attributes["age1_known"]&.zero? && field_30&.match(/\A\d{1,3}\z|\AR\z/) diff --git a/app/services/bulk_upload/sales/year2024/row_parser.rb b/app/services/bulk_upload/sales/year2024/row_parser.rb index 80748c0bc..decbb0aaa 100644 --- a/app/services/bulk_upload/sales/year2024/row_parser.rb +++ b/app/services/bulk_upload/sales/year2024/row_parser.rb @@ -785,7 +785,7 @@ private attributes["purchid"] = purchaser_code attributes["saledate"] = saledate - attributes["noint"] = 2 if field_17 == 1 + attributes["noint"] = field_17 attributes["age1_known"] = age1_known? attributes["age1"] = field_31 if attributes["age1_known"]&.zero? && field_31&.match(/\A\d{1,3}\z|\AR\z/) diff --git a/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb b/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb index 1056d4402..c4f4a26a6 100644 --- a/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb +++ b/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb @@ -1001,6 +1001,24 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do end describe "#log" do + describe "#noint" do + context "when field is set to 1" do + let(:attributes) { valid_attributes.merge({ field_28: 1 }) } + + it "is correctly set" do + expect(parser.log.noint).to be(1) + end + end + + context "when field is set to 2" do + let(:attributes) { valid_attributes.merge({ field_28: 2 }) } + + it "is correctly set" do + expect(parser.log.noint).to be(2) + end + end + end + describe "#uprn" do let(:attributes) { setup_section_params.merge({ field_19: "12" }) } diff --git a/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb b/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb index 2656ff1c0..c76fc5e64 100644 --- a/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb +++ b/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb @@ -1023,6 +1023,24 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do end describe "#log" do + describe "#noint" do + context "when field is set to 1" do + let(:attributes) { valid_attributes.merge({ field_17: 1 }) } + + it "is correctly set" do + expect(parser.log.noint).to be(1) + end + end + + context "when field is set to 2" do + let(:attributes) { valid_attributes.merge({ field_17: 2 }) } + + it "is correctly set" do + expect(parser.log.noint).to be(2) + end + end + end + describe "#uprn" do let(:attributes) { setup_section_params.merge({ field_22: "12" }) }