do not allow removing the admin group

This commit is contained in:
Johannes Zellner
2016-02-13 12:24:51 +01:00
parent 63cab7d751
commit 754e33af2a
3 changed files with 24 additions and 3 deletions

View File

@@ -58,7 +58,7 @@ describe('Groups', function () {
});
it('cannot create group - too big', function (done) {
groups.create(Array(256).join('a'), function (error) {
groups.create(new Array(256).join('a'), function (error) {
expect(error.reason).to.be(GroupError.BAD_NAME);
done();
});
@@ -275,3 +275,21 @@ describe('Set user groups', function () {
});
});
});
describe('Admin group', function () {
before(function (done) {
async.series([
setup,
userdb.add.bind(null, USER_0.id, USER_0)
], done);
});
after(cleanup);
it('cannot delete admin group ever', function (done) {
groups.remove(groups.ADMIN_GROUP_ID, function (error) {
expect(error.reason).to.equal(GroupError.NOT_ALLOWED);
done();
});
});
});