Do not allow an admin remove itself from admins group

This commit is contained in:
Johannes Zellner
2016-02-11 11:29:04 +01:00
parent 0ea89fccb8
commit 5fce9c8d1f
2 changed files with 13 additions and 0 deletions

View File

@@ -271,6 +271,16 @@ describe('User API', function () {
});
});
it('remove itself from admins fails', function (done) {
superagent.put(SERVER_URL + '/api/v1/users/' + USERNAME_0 + '/set_groups')
.query({ access_token: token })
.send({ groupIds: [ 'somegroupid' ] })
.end(function (err, res) {
expect(res.statusCode).to.equal(403);
done();
});
});
it('create user missing username fails', function (done) {
superagent.post(SERVER_URL + '/api/v1/users')
.query({ access_token: token })