From 2769e297ca6703f761f9b57792585eb1fc5aac49 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 6 Aug 2018 11:45:24 +0200 Subject: Fix caption upload on Mac OS --- server/tests/utils/videos/video-captions.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'server/tests/utils/videos/video-captions.ts') diff --git a/server/tests/utils/videos/video-captions.ts b/server/tests/utils/videos/video-captions.ts index 207e89632..41e52be07 100644 --- a/server/tests/utils/videos/video-captions.ts +++ b/server/tests/utils/videos/video-captions.ts @@ -10,10 +10,15 @@ function createVideoCaption (args: { accessToken: string videoId: string | number language: string - fixture: string + fixture: string, + mimeType?: string, + statusCodeExpected?: number }) { const path = '/api/v1/videos/' + args.videoId + '/captions/' + args.language + const captionfile = buildAbsoluteFixturePath(args.fixture) + const captionfileAttach = args.mimeType ? [ captionfile, { contentType: args.mimeType } ] : captionfile + return makeUploadRequest({ method: 'PUT', url: args.url, @@ -21,9 +26,9 @@ function createVideoCaption (args: { token: args.accessToken, fields: {}, attaches: { - captionfile: buildAbsoluteFixturePath(args.fixture) + captionfile: captionfileAttach }, - statusCodeExpected: 204 + statusCodeExpected: args.statusCodeExpected || 204 }) } -- cgit v1.2.3