From 4dbc73f9abf77af12e2f5080520405a98e548694 Mon Sep 17 00:00:00 2001 From: gaba Date: Fri, 6 Jan 2017 16:57:25 -0300 Subject: [PATCH] Add a test on already used display name. --- tests/models/user.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/models/user.js b/tests/models/user.js index 7484880bf..46584a9dc 100644 --- a/tests/models/user.js +++ b/tests/models/user.js @@ -80,6 +80,22 @@ describe('models.User', () => { }); + describe('#createLocalUser', () => { + it('should not create a user with duplicate display name', () => { + return User.createLocalUsers([{ + email: 'otrostampi@gmail.com', + displayName: 'Stampi', + password: '1Coralito!' + }]) + .then((user) => { + expect(user).to.be.null; + }) + .catch((error) => { + expect(error).to.not.be.null; + }); + }); + }); + describe('#createEmailConfirmToken', () => { it('should create a token for a valid user', () => {