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