From 6f3855fd05530b67014bc106f643e8b0e3589f04 Mon Sep 17 00:00:00 2001 From: Kat Date: Mon, 22 May 2023 09:28:02 +0100 Subject: [PATCH] Add error to the correct field --- app/services/bulk_upload/sales/year2022/row_parser.rb | 2 +- spec/services/bulk_upload/sales/year2022/row_parser_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/bulk_upload/sales/year2022/row_parser.rb b/app/services/bulk_upload/sales/year2022/row_parser.rb index 39e28a45a..65d8a8085 100644 --- a/app/services/bulk_upload/sales/year2022/row_parser.rb +++ b/app/services/bulk_upload/sales/year2022/row_parser.rb @@ -1034,7 +1034,7 @@ private if sale_type == 32 block_log_creation! - errors.add(:field_8, I18n.t("validations.invalid_option", question: "shared ownership type"), category: :setup) + errors.add(:field_57, I18n.t("validations.invalid_option", question: "shared ownership type"), category: :setup) end end end diff --git a/spec/services/bulk_upload/sales/year2022/row_parser_spec.rb b/spec/services/bulk_upload/sales/year2022/row_parser_spec.rb index f9a97f14d..19b9d0a12 100644 --- a/spec/services/bulk_upload/sales/year2022/row_parser_spec.rb +++ b/spec/services/bulk_upload/sales/year2022/row_parser_spec.rb @@ -628,7 +628,7 @@ RSpec.describe BulkUpload::Sales::Year2022::RowParser do let(:attributes) { valid_attributes.merge(field_113: 1, field_57: "32") } it "is not permitted as a setup error" do - expect(parser.errors.where(:field_8, category: :setup)).to be_present + expect(parser.errors.where(:field_57, category: :setup)).to be_present end it "blocks log creation" do