mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
test invalid expiry
This commit is contained in:
@@ -84,13 +84,13 @@ module.exports = function (User) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
User.getBannedReason = function (uid, callback) {
|
User.getBannedReason = function (uid, callback) {
|
||||||
// Grabs the latest ban reason
|
async.waterfall([
|
||||||
db.getSortedSetRevRange('banned:' + uid + ':reasons', 0, 0, function (err, reasons) {
|
function (next) {
|
||||||
if (err) {
|
db.getSortedSetRevRange('banned:' + uid + ':reasons', 0, 0, next);
|
||||||
return callback(err);
|
},
|
||||||
}
|
function (reasons, next) {
|
||||||
|
next(null, reasons.length ? reasons[0] : '');
|
||||||
callback(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 () {
|
describe('digests', function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user