diff --git a/app/services/bulk_upload/sales/year2023/row_parser.rb b/app/services/bulk_upload/sales/year2023/row_parser.rb index 91b6a0d40..f8148a720 100644 --- a/app/services/bulk_upload/sales/year2023/row_parser.rb +++ b/app/services/bulk_upload/sales/year2023/row_parser.rb @@ -1040,7 +1040,7 @@ private unless created_by.organisation == owning_organisation block_log_creation! - errors.add(:field_2, "User must be related to owning organisation") + errors.add(:field_2, "User must be related to owning organisation", category: :setup) end 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 c64a1064e..c6f1fabac 100644 --- a/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb +++ b/spec/services/bulk_upload/sales/year2023/row_parser_spec.rb @@ -372,8 +372,8 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do let(:attributes) { { bulk_upload:, field_1: owning_org.old_visible_id, field_2: other_user.email } } - it "is not permitted" do - expect(parser.errors[:field_2]).to be_present + it "is not permitted as a setup error" do + expect(parser.errors.where(:field_2, category: :setup)).to be_present end it "blocks log creation" do