diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-06-06 14:15:03 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-06-06 14:15:03 +0200 |
commit | be587647f98a4b83ca06a61fe55c7ac5d60927c6 (patch) | |
tree | 8a28a1cb9c9a06d80803ecd3fa00aa6767bb3f8b /server/tests/api/utils.js | |
parent | 8483b2216454afdb88f6aa53cad5eecd8c394bc0 (diff) | |
download | PeerTube-be587647f98a4b83ca06a61fe55c7ac5d60927c6.tar.gz PeerTube-be587647f98a4b83ca06a61fe55c7ac5d60927c6.tar.zst PeerTube-be587647f98a4b83ca06a61fe55c7ac5d60927c6.zip |
Add tags support to server
Diffstat (limited to 'server/tests/api/utils.js')
-rw-r--r-- | server/tests/api/utils.js | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/server/tests/api/utils.js b/server/tests/api/utils.js index c6430c930..e0068eada 100644 --- a/server/tests/api/utils.js +++ b/server/tests/api/utils.js | |||
@@ -349,7 +349,7 @@ function testImage (url, videoName, imagePath, callback) { | |||
349 | }) | 349 | }) |
350 | } | 350 | } |
351 | 351 | ||
352 | function uploadVideo (url, accessToken, name, description, fixture, specialStatus, end) { | 352 | function uploadVideo (url, accessToken, name, description, tags, fixture, specialStatus, end) { |
353 | if (!end) { | 353 | if (!end) { |
354 | end = specialStatus | 354 | end = specialStatus |
355 | specialStatus = 204 | 355 | specialStatus = 204 |
@@ -357,15 +357,20 @@ function uploadVideo (url, accessToken, name, description, fixture, specialStatu | |||
357 | 357 | ||
358 | const path = '/api/v1/videos' | 358 | const path = '/api/v1/videos' |
359 | 359 | ||
360 | request(url) | 360 | const req = request(url) |
361 | .post(path) | 361 | .post(path) |
362 | .set('Accept', 'application/json') | 362 | .set('Accept', 'application/json') |
363 | .set('Authorization', 'Bearer ' + accessToken) | 363 | .set('Authorization', 'Bearer ' + accessToken) |
364 | .field('name', name) | 364 | .field('name', name) |
365 | .field('description', description) | 365 | .field('description', description) |
366 | .attach('videofile', pathUtils.join(__dirname, 'fixtures', fixture)) | 366 | |
367 | .expect(specialStatus) | 367 | for (let i = 0; i < tags.length; i++) { |
368 | .end(end) | 368 | req.field('tags[' + i + ']', tags[i]) |
369 | } | ||
370 | |||
371 | req.attach('videofile', pathUtils.join(__dirname, 'fixtures', fixture)) | ||
372 | .expect(specialStatus) | ||
373 | .end(end) | ||
369 | } | 374 | } |
370 | 375 | ||
371 | // --------------------------------------------------------------------------- | 376 | // --------------------------------------------------------------------------- |