Node.js based forum software built for the modern web
fix tests
barisusakliff4c7ab3bbb0
diff --git a/test/user.js b/test/user.jsindex c956bfdcde..ece3881d66 100644--- a/test/user.js+++ b/test/user.js@@ -399,19 +399,22 @@ describe('User', function () {});it('should change a user\'s password', function (done) {- this.timeout(20000);- io.emit('user.changePassword', { uid: uid, newPassword: '654321', currentPassword: '123456' }, function (err) {+ var socketUser = require('../src/socket.io/user');+ User.create({ username: 'changepassword', password: '123456' }, function (err, uid) {assert.ifError(err);- User.isPasswordCorrect(uid, '654321', function (err, correct) {+ socketUser.changePassword({ uid: uid }, { uid: uid, newPassword: '654321', currentPassword: '123456' }, function (err) {assert.ifError(err);- assert(correct);- done();+ User.isPasswordCorrect(uid, '654321', function (err, correct) {+ assert.ifError(err);+ assert(correct);+ done();+ });});});});it('should change username', function (done) {- io.emit('user.changeUsernameEmail', { uid: uid, username: 'updatedAgain', password: '654321' }, function (err) {+ io.emit('user.changeUsernameEmail', { uid: uid, username: 'updatedAgain', password: '123456' }, function (err) {assert.ifError(err);db.getObjectField('user:' + uid, 'username', function (err, username) {assert.ifError(err);@@ -422,7 +425,7 @@ describe('User', function () {});it('should change email', function (done) {- io.emit('user.changeUsernameEmail', { uid: uid, email: '[email protected]', password: '654321' }, function (err) {+ io.emit('user.changeUsernameEmail', { uid: uid, email: '[email protected]', password: '123456' }, function (err) {assert.ifError(err);db.getObjectField('user:' + uid, 'email', function (err, email) {assert.ifError(err);