diff options
Diffstat (limited to 'packages/tests/src/api/check-params/video-captions.ts')
-rw-r--r-- | packages/tests/src/api/check-params/video-captions.ts | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/packages/tests/src/api/check-params/video-captions.ts b/packages/tests/src/api/check-params/video-captions.ts index 4150b095f..ac4e85068 100644 --- a/packages/tests/src/api/check-params/video-captions.ts +++ b/packages/tests/src/api/check-params/video-captions.ts | |||
@@ -31,15 +31,7 @@ describe('Test video captions API validator', function () { | |||
31 | 31 | ||
32 | video = await server.videos.upload() | 32 | video = await server.videos.upload() |
33 | privateVideo = await server.videos.upload({ attributes: { privacy: VideoPrivacy.PRIVATE } }) | 33 | privateVideo = await server.videos.upload({ attributes: { privacy: VideoPrivacy.PRIVATE } }) |
34 | 34 | userAccessToken = await server.users.generateUserAndToken('user1') | |
35 | { | ||
36 | const user = { | ||
37 | username: 'user1', | ||
38 | password: 'my super password' | ||
39 | } | ||
40 | await server.users.create({ username: user.username, password: user.password }) | ||
41 | userAccessToken = await server.login.getAccessToken(user) | ||
42 | } | ||
43 | }) | 35 | }) |
44 | 36 | ||
45 | describe('When adding video caption', function () { | 37 | describe('When adding video caption', function () { |
@@ -120,6 +112,19 @@ describe('Test video captions API validator', function () { | |||
120 | }) | 112 | }) |
121 | }) | 113 | }) |
122 | 114 | ||
115 | it('Should fail with another user token', async function () { | ||
116 | const captionPath = path + video.uuid + '/captions/fr' | ||
117 | await makeUploadRequest({ | ||
118 | method: 'PUT', | ||
119 | url: server.url, | ||
120 | path: captionPath, | ||
121 | token: userAccessToken, | ||
122 | fields, | ||
123 | attaches, | ||
124 | expectedStatus: HttpStatusCode.FORBIDDEN_403 | ||
125 | }) | ||
126 | }) | ||
127 | |||
123 | // We accept any file now | 128 | // We accept any file now |
124 | // it('Should fail with an invalid captionfile extension', async function () { | 129 | // it('Should fail with an invalid captionfile extension', async function () { |
125 | // const attaches = { | 130 | // const attaches = { |