X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Futils.js;h=1b2f6105949b7f7710988e3e431c247157cc40e5;hb=8c9c1942f6b5675cfca802e2f707bef3c217afbf;hp=05142085f148c3199f249abb294417b19c4f3c0f;hpb=f0f5567b6918fc60c8cab15e13aec03a89a91dfb;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/utils.js b/server/tests/api/utils.js index 05142085f..1b2f61059 100644 --- a/server/tests/api/utils.js +++ b/server/tests/api/utils.js @@ -9,6 +9,7 @@ const request = require('supertest') const testUtils = { flushTests: flushTests, getFriendsList: getFriendsList, + getVideo: getVideo, getVideosList: getVideosList, makeFriends: makeFriends, quitFriends: quitFriends, @@ -36,6 +37,17 @@ function getFriendsList (url, end) { .end(end) } +function getVideo (url, id, end) { + const path = '/api/v1/videos/' + id + + request(url) + .get(path) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) + .end(end) +} + function getVideosList (url, end) { const path = '/api/v1/videos' @@ -173,7 +185,7 @@ function uploadVideo (url, name, description, fixture, end) { .set('Accept', 'application/json') .field('name', name) .field('description', description) - .attach('input_video', pathUtils.join(__dirname, 'fixtures', fixture)) + .attach('videofile', pathUtils.join(__dirname, 'fixtures', fixture)) .expect(204) .end(end) }