notifications.pushGroups

This commit is contained in:
barisusakli
2016-11-18 11:15:22 +03:00
parent 0c9f61c629
commit f1a933210b
2 changed files with 39 additions and 0 deletions

View File

@@ -67,6 +67,32 @@ describe('Notifications', function () {
});
});
it('should push a notification to a group', function (done) {
notifications.pushGroup(notification, 'registered-users', function (err) {
assert.ifError(err);
setTimeout(function () {
db.isSortedSetMember('uid:' + uid + ':notifications:unread', notification.nid, function (err, isMember) {
assert.ifError(err);
assert(isMember);
done();
});
}, 2000);
});
});
it('should push a notification to groups', function (done) {
notifications.pushGroup(notification, ['registered-users', 'administrators'], function (err) {
assert.ifError(err);
setTimeout(function () {
db.isSortedSetMember('uid:' + uid + ':notifications:unread', notification.nid, function (err, isMember) {
assert.ifError(err);
assert(isMember);
done();
});
}, 2000);
});
});
it('should mark a notification read', function (done) {
notifications.markRead(notification.nid, uid, function (err) {
assert.ifError(err);