test invalid expiry

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

@ -84,13 +84,13 @@ module.exports = function (User) {
};
User.getBannedReason = function (uid, callback) {
// Grabs the latest ban reason
db.getSortedSetRevRange('banned:' + uid + ':reasons', 0, 0, function (err, reasons) {
if (err) {
return callback(err);
}
callback(null, reasons.length ? reasons[0] : '');
});
async.waterfall([
function (next) {
db.getSortedSetRevRange('banned:' + uid + ':reasons', 0, 0, next);
},
function (reasons, next) {
next(null, reasons.length ? reasons[0] : '');
},
], callback);
};
};

@ -827,6 +827,13 @@ describe('User', function () {
});
});
});
it('should error if until is NaN', function (done) {
User.ban(testUid, 'asd', function (err) {
assert.equal(err.message, '[[error:ban-expiry-missing]]');
done();
});
});
});
describe('digests', function () {

Loading…
Cancel
Save