let server: ServerInfo
let serverWithRegistrationDisabled: ServerInfo
let userAccessToken = ''
+ const user = {
+ username: 'user1',
+ password: 'my super password'
+ }
// ---------------------------------------------------------------
before(async function () {
- this.timeout(20000)
+ this.timeout(30000)
await flushTests()
await setAccessTokensToServers([ server ])
- const user = {
- username: 'user1',
- password: 'my super password'
- }
const videoQuota = 42000000
await createUser(server.url, server.accessToken, user.username, user.password, videoQuota)
userAccessToken = await userLogin(server, user)
await makePutBodyRequest({ url: server.url, path: path + userId, token: 'super token', fields, statusCodeExpected: 401 })
})
+ it('Should fail when updating root role', async function () {
+ const fields = {
+ role: UserRole.MODERATOR
+ }
+
+ await makePutBodyRequest({ url: server.url, path: path + rootId, token: server.accessToken, fields })
+ })
+
it('Should succeed with the correct params', async function () {
const fields = {
email: 'email@example.com',
}
await makePutBodyRequest({ url: server.url, path: path + userId, token: server.accessToken, fields, statusCodeExpected: 204 })
+ userAccessToken = await userLogin(server, user)
})
})
})
it('Should fail with a registered user having too many video', async function () {
- this.timeout(10000)
+ this.timeout(15000)
const user = {
username: 'user3',