X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Fresumable-upload.ts;h=6b5e0c09d79b5ce034cc46c51e85ae8b9026f578;hb=276250f0a36e00373166d91d539e5220d6f158c7;hp=59970aa943ea57854b3387cd0d7a3fa0617908c9;hpb=b2ad0090c182c7f2a8cba1cced3987d408a4b159;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/resumable-upload.ts b/server/tests/api/videos/resumable-upload.ts index 59970aa94..6b5e0c09d 100644 --- a/server/tests/api/videos/resumable-upload.ts +++ b/server/tests/api/videos/resumable-upload.ts @@ -180,6 +180,21 @@ describe('Test resumable upload', function () { await sendChunks({ pathUploadId: uploadId, expectedStatus, contentRangeBuilder, contentLength: size }) await checkFileSize(uploadId, 0) }) + + it('Should be able to accept 2 PUT requests', async function () { + const uploadId = await prepareUpload() + + const result1 = await sendChunks({ pathUploadId: uploadId }) + const result2 = await sendChunks({ pathUploadId: uploadId }) + + expect(result1.body.video.uuid).to.exist + expect(result1.body.video.uuid).to.equal(result2.body.video.uuid) + + expect(result1.headers['x-resumable-upload-cached']).to.not.exist + expect(result2.headers['x-resumable-upload-cached']).to.equal('true') + + await checkFileSize(uploadId, null) + }) }) after(async function () {