aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-05-10 11:48:27 +0200
committerChocobozzz <me@florianbigard.com>2023-05-10 11:53:04 +0200
commit7590f7a8684c69c38d30dab68377720da16d2420 (patch)
treecb03364267103afd3e1c2b298d6b900d8eede916 /server/tests/api
parent89fc0142625126b0a2923c9d625be5d201354bb7 (diff)
downloadPeerTube-7590f7a8684c69c38d30dab68377720da16d2420.tar.gz
PeerTube-7590f7a8684c69c38d30dab68377720da16d2420.tar.zst
PeerTube-7590f7a8684c69c38d30dab68377720da16d2420.zip
Add more tests on registration request conflict
Diffstat (limited to 'server/tests/api')
-rw-r--r--server/tests/api/check-params/registrations.ts15
1 files changed, 14 insertions, 1 deletions
diff --git a/server/tests/api/check-params/registrations.ts b/server/tests/api/check-params/registrations.ts
index fe16ebd93..8cbecdd07 100644
--- a/server/tests/api/check-params/registrations.ts
+++ b/server/tests/api/check-params/registrations.ts
@@ -254,7 +254,7 @@ describe('Test registrations API validators', function () {
254 }) 254 })
255 }) 255 })
256 256
257 it('Should fail if the user is already awaiting registration approval', async function () { 257 it('Should fail if the username is already awaiting registration approval', async function () {
258 await server.registrations.requestRegistration({ 258 await server.registrations.requestRegistration({
259 username: 'user_request_2', 259 username: 'user_request_2',
260 registrationReason: 'tt', 260 registrationReason: 'tt',
@@ -266,6 +266,19 @@ describe('Test registrations API validators', function () {
266 }) 266 })
267 }) 267 })
268 268
269 it('Should fail if the email is already awaiting registration approval', async function () {
270 await server.registrations.requestRegistration({
271 username: 'user42',
272 email: 'user_request_2@example.com',
273 registrationReason: 'tt',
274 channel: {
275 displayName: 'my user request 42 channel',
276 name: 'user_request_42_channel'
277 },
278 expectedStatus: HttpStatusCode.CONFLICT_409
279 })
280 })
281
269 it('Should fail if the channel is already awaiting registration approval', async function () { 282 it('Should fail if the channel is already awaiting registration approval', async function () {
270 await server.registrations.requestRegistration({ 283 await server.registrations.requestRegistration({
271 username: 'user42', 284 username: 'user42',