From a7e2194afd23700a0ed1059a809b0febfdb4121e Mon Sep 17 00:00:00 2001 From: Sam Seed Date: Thu, 9 Feb 2023 18:37:43 +0000 Subject: [PATCH] test: update error message to be a real error message --- .../bulk_upload/lettings/row_parser_spec.rb | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/spec/services/bulk_upload/lettings/row_parser_spec.rb b/spec/services/bulk_upload/lettings/row_parser_spec.rb index 8e73e70e8..8154ee122 100644 --- a/spec/services/bulk_upload/lettings/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/row_parser_spec.rb @@ -206,21 +206,22 @@ RSpec.describe BulkUpload::Lettings::RowParser do it "adds an error to all (and only) the fields used to determine duplicity" do parser.valid? + error_message = "This is a duplicate log" expected_errors = { - :field_96 => ["test"], # startdate - :field_97 => ["test"], # startdate - :field_98 => ["test"], # startdate - :field_108 => ["test"], # postcode_full - :field_109 => ["test"], # postcode_full - :field_80 => ["test"], # brent - :field_81 => ["test"], # scharge - :field_82 => ["test"], # pscharge - :field_83 => ["test"], # supcharg - :field_7 => ["test"], # tenancycode - :field_12 => ["test"], # age1 - :field_20 => ["test"], # sex1 - :field_35 => ["test"], # ecstat1 - :field_43 => ["test"], # ethnic + :field_96 => [error_message], # startdate + :field_97 => [error_message], # startdate + :field_98 => [error_message], # startdate + :field_108 => [error_message], # postcode_full + :field_109 => [error_message], # postcode_full + :field_80 => [error_message], # brent + :field_81 => [error_message], # scharge + :field_82 => [error_message], # pscharge + :field_83 => [error_message], # supcharg + :field_7 => [error_message], # tenancycode + :field_12 => [error_message], # age1 + :field_20 => [error_message], # sex1 + :field_35 => [error_message], # ecstat1 + :field_43 => [error_message], # ethnic } expect(parser.errors.as_json).to eq(expected_errors) end