describe('Of the users API', function () {
const path = '/api/v1/users/'
let userId = null
+ let rootId = null
describe('When listing users', function () {
it('Should fail with a bad start pagination', function (done) {
if (err) throw err
userId = res.body.data[1].id
+ rootId = res.body.data[2].id
done()
})
})
.expect(400, done)
})
+ it('Should fail with the root user', function (done) {
+ request(server.url)
+ .delete(path + rootId)
+ .set('Authorization', 'Bearer ' + server.accessToken)
+ .expect(400, done)
+ })
+
it('Should return 404 with a non existing id', function (done) {
request(server.url)
.delete(path + '579f982228c99c221d8092b8')