From f4001cf408a99049d01a356bfb20a62342de06ea Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 16 Jul 2018 14:22:16 +0200 Subject: Handle .srt subtitles --- server/tests/api/check-params/video-captions.ts | 35 ++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'server/tests/api/check-params') diff --git a/server/tests/api/check-params/video-captions.ts b/server/tests/api/check-params/video-captions.ts index 12f890db8..a3d7ac35d 100644 --- a/server/tests/api/check-params/video-captions.ts +++ b/server/tests/api/check-params/video-captions.ts @@ -1,6 +1,5 @@ /* tslint:disable:no-unused-expression */ -import * as chai from 'chai' import 'mocha' import { createUser, @@ -127,6 +126,40 @@ describe('Test video captions API validator', function () { }) }) + it('Should fail with an invalid captionfile extension', async function () { + const attaches = { + 'captionfile': join(__dirname, '..', '..', 'fixtures', 'subtitle-bad.txt') + } + + const captionPath = path + videoUUID + '/captions/fr' + await makeUploadRequest({ + method: 'PUT', + url: server.url, + path: captionPath, + token: server.accessToken, + fields, + attaches, + statusCodeExpected: 400 + }) + }) + + // it('Should fail with an invalid captionfile srt', async function () { + // const attaches = { + // 'captionfile': join(__dirname, '..', '..', 'fixtures', 'subtitle-bad.srt') + // } + // + // const captionPath = path + videoUUID + '/captions/fr' + // await makeUploadRequest({ + // method: 'PUT', + // url: server.url, + // path: captionPath, + // token: server.accessToken, + // fields, + // attaches, + // statusCodeExpected: 500 + // }) + // }) + it('Should success with the correct parameters', async function () { const captionPath = path + videoUUID + '/captions/fr' await makeUploadRequest({ -- cgit v1.2.3