|
|
|
@ -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 |
|
|
|
|