- 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 () {
+ const fields = {}
+ const attaches = {
+ avatarfile: join(__dirname, '..', '..', 'fixtures', 'avatar.png')
+ }
+ await makeUploadRequest({
+ url: server.url,
+ path: path + '/avatar/pick',
+ fields,
+ attaches,
+ statusCodeExpected: 401
+ })
+ })
+
+ it('Should succeed with the correct params', async function () {
+ const fields = {}
+ const attaches = {
+ avatarfile: join(__dirname, '..', '..', 'fixtures', 'avatar.png')
+ }
+ await makeUploadRequest({
+ url: server.url,
+ path: path + '/avatar/pick',
+ token: server.accessToken,
+ fields,
+ attaches,
+ statusCodeExpected: 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,
+ statusCodeExpected: 200
+ })
+
+ expect(res.body.data).to.be.an('array')