From f2eb23cd87cf32b8fe545178143b5f49e06a58da Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Tue, 8 Dec 2020 21:16:10 +0100 Subject: emit more specific status codes on video upload (#3423) - reduce http status codes list to potentially useful codes - convert more codes to typed ones - factorize html generator for error responses --- server/tests/api/check-params/users.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'server/tests/api/check-params/users.ts') diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts index 21ace36aa..0a13f5b67 100644 --- a/server/tests/api/check-params/users.ts +++ b/server/tests/api/check-params/users.ts @@ -1102,7 +1102,7 @@ describe('Test users API validators', function () { videoQuota: 42 }) - await uploadVideo(server.url, server.accessToken, {}, HttpStatusCode.FORBIDDEN_403) + await uploadVideo(server.url, server.accessToken, {}, HttpStatusCode.PAYLOAD_TOO_LARGE_413) }) it('Should fail with a registered user having too many videos', async function () { @@ -1120,7 +1120,7 @@ describe('Test users API validators', function () { await uploadVideo(server.url, userAccessToken, videoAttributes) await uploadVideo(server.url, userAccessToken, videoAttributes) await uploadVideo(server.url, userAccessToken, videoAttributes) - await uploadVideo(server.url, userAccessToken, videoAttributes, HttpStatusCode.FORBIDDEN_403) + await uploadVideo(server.url, userAccessToken, videoAttributes, HttpStatusCode.PAYLOAD_TOO_LARGE_413) }) it('Should fail to import with HTTP/Torrent/magnet', async function () { @@ -1151,7 +1151,7 @@ describe('Test users API validators', function () { }) describe('When having a daily video quota', function () { - it('Should fail with a user having too many videos', async function () { + it('Should fail with a user having too many videos daily', async function () { await updateUser({ url: server.url, userId: rootId, @@ -1159,7 +1159,7 @@ describe('Test users API validators', function () { videoQuotaDaily: 42 }) - await uploadVideo(server.url, server.accessToken, {}, HttpStatusCode.FORBIDDEN_403) + await uploadVideo(server.url, server.accessToken, {}, HttpStatusCode.PAYLOAD_TOO_LARGE_413) }) }) @@ -1173,7 +1173,7 @@ describe('Test users API validators', function () { videoQuotaDaily: 1024 * 1024 * 1024 }) - await uploadVideo(server.url, server.accessToken, {}, HttpStatusCode.FORBIDDEN_403) + await uploadVideo(server.url, server.accessToken, {}, HttpStatusCode.PAYLOAD_TOO_LARGE_413) }) it('Should fail if exceeding daily quota', async function () { @@ -1185,7 +1185,7 @@ describe('Test users API validators', function () { videoQuotaDaily: 42 }) - await uploadVideo(server.url, server.accessToken, {}, HttpStatusCode.FORBIDDEN_403) + await uploadVideo(server.url, server.accessToken, {}, HttpStatusCode.PAYLOAD_TOO_LARGE_413) }) }) -- cgit v1.2.3