1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Begin to add avatar to actors

This commit is contained in:
Chocobozzz 2017-12-29 19:10:13 +01:00
parent 8b0d42ee37
commit c5911fd347
No known key found for this signature in database
GPG key ID: 583A612D890159BE
41 changed files with 498 additions and 177 deletions

View file

@ -2,11 +2,13 @@
import { omit } from 'lodash'
import 'mocha'
import { join } from "path"
import { UserRole } from '../../../../shared'
import {
createUser, flushTests, getMyUserInformation, getMyUserVideoRating, getUsersList, immutableAssign, killallServers, makeGetRequest,
makePostBodyRequest, makePutBodyRequest, registerUser, removeUser, runServer, ServerInfo, setAccessTokensToServers, updateUser,
makePostBodyRequest, makePostUploadRequest, makePutBodyRequest, registerUser, removeUser, runServer, ServerInfo, setAccessTokensToServers,
updateUser,
uploadVideo, userLogin
} from '../../utils'
import { checkBadCountPagination, checkBadSortPagination, checkBadStartPagination } from '../../utils/requests/check-api-params'
@ -266,6 +268,24 @@ describe('Test users API validators', function () {
})
})
describe('When updating my avatar', function () {
it('Should fail without an incorrect input file', async function () {
const fields = {}
const attaches = {
'avatarfile': join(__dirname, '..', 'fixtures', 'video_short.mp4')
}
await makePostUploadRequest({ url: server.url, path: path + '/me/avatar/pick', token: server.accessToken, fields, attaches })
})
it('Should succeed with the correct params', async function () {
const fields = {}
const attaches = {
'avatarfile': join(__dirname, '..', 'fixtures', 'avatar.png')
}
await makePostUploadRequest({ url: server.url, path: path + '/me/avatar/pick', token: server.accessToken, fields, attaches })
})
})
describe('When updating a user', function () {
before(async function () {