Browse Source

test: update error message to be a real error message

cldc-1888-bulk-upload-duplicate-log-validation
Sam Seed 2 years ago
parent
commit
a7e2194afd
  1. 29
      spec/services/bulk_upload/lettings/row_parser_spec.rb

29
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 it "adds an error to all (and only) the fields used to determine duplicity" do
parser.valid? parser.valid?
error_message = "This is a duplicate log"
expected_errors = { expected_errors = {
:field_96 => ["test"], # startdate :field_96 => [error_message], # startdate
:field_97 => ["test"], # startdate :field_97 => [error_message], # startdate
:field_98 => ["test"], # startdate :field_98 => [error_message], # startdate
:field_108 => ["test"], # postcode_full :field_108 => [error_message], # postcode_full
:field_109 => ["test"], # postcode_full :field_109 => [error_message], # postcode_full
:field_80 => ["test"], # brent :field_80 => [error_message], # brent
:field_81 => ["test"], # scharge :field_81 => [error_message], # scharge
:field_82 => ["test"], # pscharge :field_82 => [error_message], # pscharge
:field_83 => ["test"], # supcharg :field_83 => [error_message], # supcharg
:field_7 => ["test"], # tenancycode :field_7 => [error_message], # tenancycode
:field_12 => ["test"], # age1 :field_12 => [error_message], # age1
:field_20 => ["test"], # sex1 :field_20 => [error_message], # sex1
:field_35 => ["test"], # ecstat1 :field_35 => [error_message], # ecstat1
:field_43 => ["test"], # ethnic :field_43 => [error_message], # ethnic
} }
expect(parser.errors.as_json).to eq(expected_errors) expect(parser.errors.as_json).to eq(expected_errors)
end end

Loading…
Cancel
Save