mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 00:10:25 +01:00
additional tests for post diffs privilege checking
This commit is contained in:
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user