- it('Should fail without a correct uuid', async function () {
- await request(server.url)
- .get(path + '/coucou')
- .set('Accept', 'application/json')
- .expect(400)
+ it('Should fail with an unauthenticated user', async function () {
+ for (const type of types) {
+ const fields = {}
+ const attaches = {
+ [type + 'file']: buildAbsoluteFixturePath('avatar.png')
+ }
+ await makeUploadRequest({
+ url: server.url,
+ path: `${path}/${type}/pick`,
+ fields,
+ attaches,
+ expectedStatus: HttpStatusCode.UNAUTHORIZED_401
+ })
+ }
+ })
+
+ it('Should succeed with the correct params', async function () {
+ for (const type of types) {
+ const fields = {}
+ const attaches = {
+ [type + 'file']: buildAbsoluteFixturePath('avatar.png')
+ }
+ await makeUploadRequest({
+ url: server.url,
+ path: `${path}/${type}/pick`,
+ token: server.accessToken,
+ fields,
+ attaches,
+ expectedStatus: HttpStatusCode.OK_200
+ })
+ }
+ })
+ })
+
+ describe('When getting a video channel', function () {
+ it('Should return the list of the video channels with nothing', async function () {
+ const res = await makeGetRequest({
+ url: server.url,
+ path: videoChannelPath,
+ expectedStatus: HttpStatusCode.OK_200
+ })
+
+ expect(res.body.data).to.be.an('array')