fix digest test

v1.18.x
Baris Usakli 8 years ago
parent 77103fb3d1
commit 74ed033e4a

@ -991,23 +991,27 @@ describe('User', function () {
describe('digests', function () { describe('digests', function () {
var uid; var uid;
before(function (done) { before(function (done) {
User.create({ username: 'digestuser', email: 'test@example.com' }, function (err, _uid) { async.waterfall([
assert.ifError(err); function (next) {
User.create({ username: 'digestuser', email: 'test@example.com' }, next);
},
function (_uid, next) {
uid = _uid; uid = _uid;
done(); User.updateDigestSetting(uid, 'day', next);
}); },
function (next) {
User.setSetting(uid, 'dailyDigestFreq', 'day', next);
},
], done);
}); });
it('should send digests', function (done) { it('should send digests', function (done) {
User.updateDigestSetting(uid, 'day', function (err) {
assert.ifError(err);
User.digest.execute({ interval: 'day' }, function (err) { User.digest.execute({ interval: 'day' }, function (err) {
assert.ifError(err); assert.ifError(err);
done(); done();
}); });
}); });
}); });
});
describe('socket methods', function () { describe('socket methods', function () {
var socketUser = require('../src/socket.io/user'); var socketUser = require('../src/socket.io/user');

Loading…
Cancel
Save