Add a test on already used display name.

This commit is contained in:
gaba
2017-01-06 16:57:25 -03:00
parent 712e436f58
commit 4dbc73f9ab
+16
View File
@@ -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', () => {