|
|
|
@ -942,6 +942,19 @@ describe('Groups', function () {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should fail to rename guests group', function (done) {
|
|
|
|
|
var data = {
|
|
|
|
|
groupName: 'guests',
|
|
|
|
|
values: {
|
|
|
|
|
name: 'guests2',
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
socketGroups.update({ uid: adminUid }, data, function (err) {
|
|
|
|
|
assert.equal(err.message, '[[error:no-group]]');
|
|
|
|
|
done();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should delete group', function (done) {
|
|
|
|
|
socketGroups.delete({ uid: adminUid }, { groupName: 'renamedupdategroup' }, function (err) {
|
|
|
|
|
assert.ifError(err);
|
|
|
|
@ -974,6 +987,13 @@ describe('Groups', function () {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should fail to delete group if name is special', function (done) {
|
|
|
|
|
socketGroups.delete({ uid: adminUid }, { groupName: 'guests' }, function (err) {
|
|
|
|
|
assert.equal(err.message, '[[error:not-allowed]]');
|
|
|
|
|
done();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should fail to load more groups with invalid data', function (done) {
|
|
|
|
|
socketGroups.loadMore({ uid: adminUid }, {}, function (err) {
|
|
|
|
|
assert.equal(err.message, '[[error:invalid-data]]');
|
|
|
|
|