diff --git a/core/client/app/components/modals/new-subscriber.js b/core/client/app/components/modals/new-subscriber.js index 01e50958d7..246d24b7f7 100644 --- a/core/client/app/components/modals/new-subscriber.js +++ b/core/client/app/components/modals/new-subscriber.js @@ -18,7 +18,7 @@ export default ModalComponent.extend({ this.send('closeModal'); }).catch((errors) => { let [error] = errors; - if (error && error.match(/email/)) { + if (error && error.match(/email/i)) { this.get('model.errors').add('email', error); this.get('model.hasValidated').pushObject('email'); } diff --git a/core/client/app/mirage/config.js b/core/client/app/mirage/config.js index 3b88413420..742bd4491d 100644 --- a/core/client/app/mirage/config.js +++ b/core/client/app/mirage/config.js @@ -60,8 +60,8 @@ function mockSubscribers(server) { if (subscriber) { return new Mirage.Response(422, {}, { errors: [{ - errorType: 'DataImportError', - message: 'duplicate email', + errorType: 'ValidationError', + message: 'Email already exists.', property: 'email' }] }); diff --git a/core/client/tests/acceptance/subscribers-test.js b/core/client/tests/acceptance/subscribers-test.js index b448f554d1..9c828b737c 100644 --- a/core/client/tests/acceptance/subscribers-test.js +++ b/core/client/tests/acceptance/subscribers-test.js @@ -177,7 +177,7 @@ describe('Acceptance: Subscribers', function() { andThen(function () { // the validation error is displayed expect(find('.fullscreen-modal .error .response').text().trim(), 'duplicate email validation') - .to.match(/duplicate/); + .to.equal('Email already exists.'); // the subscriber is not added to the table expect(find('.lt-cell:contains(test@example.com)').length, 'number of "test@example.com rows"')