Fix tests

This commit is contained in:
André Zanghelini
2017-07-05 19:57:56 -03:00
parent cdad5bf8c2
commit 9fd542d897

View File

@@ -55,6 +55,7 @@ describe('authentication', function () {
email: email, email: email,
username: username, username: username,
password: password, password: password,
'password-confirm': password,
}, },
json: true, json: true,
jar: jar, jar: jar,
@@ -70,7 +71,7 @@ describe('authentication', function () {
var jar = request.jar(); var jar = request.jar();
var regularUid; var regularUid;
before(function (done) { before(function (done) {
user.create({ username: 'regular', password: 'regularpwd', 'password-confirm': 'regularpwd', email: 'regular@nodebb.org' }, function (err, uid) { user.create({ username: 'regular', password: 'regularpwd', email: 'regular@nodebb.org' }, function (err, uid) {
assert.ifError(err); assert.ifError(err);
regularUid = uid; regularUid = uid;
done(); done();
@@ -90,6 +91,7 @@ describe('authentication', function () {
email: 'admin@nodebb.org', email: 'admin@nodebb.org',
username: 'admin', username: 'admin',
password: 'adminpwd', password: 'adminpwd',
'password-confirm': 'adminpwd',
userLang: 'it', userLang: 'it',
}, },
json: true, json: true,
@@ -349,7 +351,7 @@ describe('authentication', function () {
}); });
it('should prevent banned user from logging in', function (done) { it('should prevent banned user from logging in', function (done) {
user.create({ username: 'banme', password: '123456', 'password-confirm': '123456', email: 'ban@me.com' }, function (err, uid) { user.create({ username: 'banme', password: '123456', email: 'ban@me.com' }, function (err, uid) {
assert.ifError(err); assert.ifError(err);
user.ban(uid, 0, 'spammer', function (err) { user.ban(uid, 0, 'spammer', function (err) {
assert.ifError(err); assert.ifError(err);
@@ -380,7 +382,7 @@ describe('authentication', function () {
var uid; var uid;
async.waterfall([ async.waterfall([
function (next) { function (next) {
user.create({ username: 'lockme', password: '123456', 'password-confirm': '123456' }, next); user.create({ username: 'lockme', password: '123456' }, next);
}, },
function (_uid, next) { function (_uid, next) {
uid = _uid; uid = _uid;