PeerTube/server/tests/utils/video-blacklists.js

30 lines
651 B
JavaScript
Raw Normal View History

2017-05-01 12:04:29 -05:00
'use strict'
const request = require('supertest')
const videosBlacklistsUtils = {
addVideoToBlacklist
}
// ---------------------- Export functions --------------------
function addVideoToBlacklist (url, token, videoId, specialStatus, end) {
if (!end) {
end = specialStatus
specialStatus = 204
}
const path = '/api/v1/videos/' + videoId + '/blacklist'
request(url)
.post(path)
.set('Accept', 'application/json')
.set('Authorization', 'Bearer ' + token)
.expect(specialStatus)
.end(end)
}
// ---------------------------------------------------------------------------
module.exports = videosBlacklistsUtils