digest cleanup and tests

This commit is contained in:
Barış Soner Uşaklı
2017-05-16 17:14:50 -04:00
parent 5f1eb70d01
commit e49f33317d
3 changed files with 157 additions and 138 deletions

View File

@@ -1301,6 +1301,30 @@ describe('User', function () {
});
});
describe('user jobs', function () {
it('should start user jobs', function (done) {
User.startJobs(function (err) {
assert.ifError(err);
done();
});
});
it('should stop user jobs', function (done) {
User.stopJobs();
done();
});
it('should send digetst', function (done) {
db.sortedSetAdd('digest:day:uids', [Date.now(), Date.now()], [1, 2], function (err) {
assert.ifError(err);
User.digest.execute('day', function (err) {
assert.ifError(err);
done();
});
});
});
});
after(function (done) {
db.emptydb(done);