]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/check-params/users.ts
emit more specific status codes on video upload (#3423)
[github/Chocobozzz/PeerTube.git] / server / tests / api / check-params / users.ts
index 21ace36aa573474b138cab5e3ed52081d160d918..0a13f5b678cefc1168b4b4dae95200c37a43c5f3 100644 (file)
@@ -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)
     })
   })