From 2c5d00e19621c1589e6d7ad89e95a8e73dc1107c Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Tue, 2 May 2023 16:25:08 +0100 Subject: [PATCH] add bulk upload sales 23 nationalbuy2 field --- app/services/bulk_upload/sales/year2023/row_parser.rb | 1 + .../bulk_upload/sales/year2023/row_parser_spec.rb | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/app/services/bulk_upload/sales/year2023/row_parser.rb b/app/services/bulk_upload/sales/year2023/row_parser.rb index 899f9522a..0d2dc2ccf 100644 --- a/app/services/bulk_upload/sales/year2023/row_parser.rb +++ b/app/services/bulk_upload/sales/year2023/row_parser.rb @@ -754,6 +754,7 @@ private attributes["ethnic_group2"] = infer_buyer2_ethnic_group_from_ethnic attributes["ethnicbuy2"] = field_40 + attributes["nationalbuy2"] = field_41 attributes end 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 475a8703f..f1ec2a52b 100644 --- a/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb +++ b/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb @@ -643,5 +643,13 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do expect(parser.log.ethnicbuy2).to be(1) end end + + describe "#nationalbuy2" do + let(:attributes) { setup_section_params.merge({ field_41: "18" }) } + + it "is correctly set" do + expect(parser.log.nationalbuy2).to be(18) + end + end end end