Merge pull request #921 from mleanos/dbseed-user-passwords

[hotfix] Fixes db seed password bug
This commit is contained in:
Liran Tal
2015-09-25 08:37:40 +03:00
4 changed files with 97 additions and 33 deletions

View File

@@ -228,6 +228,22 @@ describe('User Model Unit Tests:', function () {
});
});
it('should validate a randomly generated passphrase from the static schema method', function () {
var _user1 = new User(user1);
User.generateRandomPassphrase()
.then(function (password) {
_user1.password = password;
_user1.validate(function (err) {
should.not.exist(err);
});
})
.catch(function (err) {
should.not.exist(err);
});
});
it('should validate when the password is undefined', function () {
var _user1 = new User(user1);
_user1.password = undefined;