additional tests for post diffs privilege checking

v1.18.x
Julian Lam 7 years ago
parent 176c455152
commit 8e832abf1e

@ -461,6 +461,22 @@ describe('Post\'s', function () {
done();
});
});
it('should not allow guests to view diffs', function (done) {
socketPosts.getDiffs({ uid: 0 }, { pid: 1 }, function (err) {
assert.equal(err.message, '[[error:no-privileges]]');
done();
});
});
it('should allow registered-users group to view diffs', function (done) {
socketPosts.getDiffs({ uid: 1 }, { pid: 1 }, function (err, timestamps) {
assert.ifError(err);
assert.equal(true, Array.isArray(timestamps));
assert.strictEqual(1, timestamps.length);
done();
});
});
});
describe('move', function () {

Loading…
Cancel
Save