perma and temp ban test

v1.18.x
Barış Soner Uşaklı 8 years ago
parent 33023ea419
commit a28b76861d

@ -798,6 +798,35 @@ describe('User', function () {
});
});
});
it('should ban user permanently', function (done) {
User.ban(testUid, function (err) {
assert.ifError(err);
User.isBanned(testUid, function (err, isBanned) {
assert.ifError(err);
assert.equal(isBanned, true);
User.unban(testUid, done);
});
});
});
it('should ban user temporarily', function (done) {
User.ban(testUid, Date.now() + 2000, function (err) {
assert.ifError(err);
User.isBanned(testUid, function (err, isBanned) {
assert.ifError(err);
assert.equal(isBanned, true);
setTimeout(function () {
User.isBanned(testUid, function (err, isBanned) {
assert.ifError(err);
assert.equal(isBanned, false);
User.unban(testUid, done);
});
}, 3000);
});
});
});
});
describe('digests', function () {

Loading…
Cancel
Save