aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/check-params/users.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts
index dba57778d..f36146c53 100644
--- a/server/tests/api/check-params/users.ts
+++ b/server/tests/api/check-params/users.ts
@@ -179,6 +179,18 @@ describe('Test users API validators', function () {
179 await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields }) 179 await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
180 }) 180 })
181 181
182 it('Should fail with a "peertube" username', async function () {
183 const fields = immutableAssign(baseCorrectParams, { username: 'peertube' })
184
185 await makePostBodyRequest({
186 url: server.url,
187 path,
188 token: server.accessToken,
189 fields,
190 statusCodeExpected: 409
191 })
192 })
193
182 it('Should succeed with the correct params', async function () { 194 it('Should succeed with the correct params', async function () {
183 await makePostBodyRequest({ 195 await makePostBodyRequest({
184 url: server.url, 196 url: server.url,
@@ -493,6 +505,18 @@ describe('Test users API validators', function () {
493 }) 505 })
494 }) 506 })
495 507
508 it('Should fail with a "peertube" username', async function () {
509 const fields = immutableAssign(baseCorrectParams, { username: 'peertube' })
510
511 await makePostBodyRequest({
512 url: server.url,
513 path: registrationPath,
514 token: server.accessToken,
515 fields,
516 statusCodeExpected: 409
517 })
518 })
519
496 it('Should fail if we register a user with the same email', async function () { 520 it('Should fail if we register a user with the same email', async function () {
497 const fields = immutableAssign(baseCorrectParams, { email: 'admin1@example.com' }) 521 const fields = immutableAssign(baseCorrectParams, { email: 'admin1@example.com' })
498 522