From f440108bff8304778489c9971510e27457e84eb4 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Tue, 2 May 2023 16:28:47 +0100 Subject: [PATCH] handle buy2living for bulk upload sales 2023 --- app/services/bulk_upload/sales/year2023/row_parser.rb | 2 ++ .../bulk_upload/sales/year2023/row_parser_spec.rb | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/app/services/bulk_upload/sales/year2023/row_parser.rb b/app/services/bulk_upload/sales/year2023/row_parser.rb index 0d2dc2ccf..7ab51ef12 100644 --- a/app/services/bulk_upload/sales/year2023/row_parser.rb +++ b/app/services/bulk_upload/sales/year2023/row_parser.rb @@ -756,6 +756,8 @@ private attributes["ethnicbuy2"] = field_40 attributes["nationalbuy2"] = field_41 + attributes["buy2living"] = field_71 + 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 f1ec2a52b..a90fc07e8 100644 --- a/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb +++ b/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb @@ -651,5 +651,13 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do expect(parser.log.nationalbuy2).to be(18) end end + + describe "#buy2living" do + let(:attributes) { setup_section_params.merge({ field_71: "1" }) } + + it "is correctly set" do + expect(parser.log.buy2living).to be(1) + end + end end end