aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/users
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-29 11:29:23 +0200
committerChocobozzz <me@florianbigard.com>2018-06-29 11:29:23 +0200
commit4bbfc6c606c8d3794bae25c64c516120af41f4eb (patch)
tree8d6012f3c04e55e7325e3f00eb9061776cc7a953 /server/tests/utils/users
parent3ff5a19b4c988d6c712b7ce63c4cf04f99d047ce (diff)
downloadPeerTube-4bbfc6c606c8d3794bae25c64c516120af41f4eb.tar.gz
PeerTube-4bbfc6c606c8d3794bae25c64c516120af41f4eb.tar.zst
PeerTube-4bbfc6c606c8d3794bae25c64c516120af41f4eb.zip
API: Add ability to update video channel avatar
Diffstat (limited to 'server/tests/utils/users')
-rw-r--r--server/tests/utils/users/users.ts18
1 files changed, 2 insertions, 16 deletions
diff --git a/server/tests/utils/users/users.ts b/server/tests/utils/users/users.ts
index 34d50f7ad..37b15f64a 100644
--- a/server/tests/utils/users/users.ts
+++ b/server/tests/utils/users/users.ts
@@ -1,6 +1,5 @@
1import { isAbsolute, join } from 'path'
2import * as request from 'supertest' 1import * as request from 'supertest'
3import { makePostBodyRequest, makeUploadRequest, makePutBodyRequest } from '../' 2import { makePostBodyRequest, makePutBodyRequest, updateAvatarRequest } from '../'
4 3
5import { UserRole } from '../../../../shared/index' 4import { UserRole } from '../../../../shared/index'
6import { NSFWPolicyType } from '../../../../shared/models/videos/nsfw-policy.type' 5import { NSFWPolicyType } from '../../../../shared/models/videos/nsfw-policy.type'
@@ -160,21 +159,8 @@ function updateMyAvatar (options: {
160 fixture: string 159 fixture: string
161}) { 160}) {
162 const path = '/api/v1/users/me/avatar/pick' 161 const path = '/api/v1/users/me/avatar/pick'
163 let filePath = ''
164 if (isAbsolute(options.fixture)) {
165 filePath = options.fixture
166 } else {
167 filePath = join(__dirname, '..', '..', 'fixtures', options.fixture)
168 }
169 162
170 return makeUploadRequest({ 163 return updateAvatarRequest(Object.assign(options, { path }))
171 url: options.url,
172 path,
173 token: options.accessToken,
174 fields: {},
175 attaches: { avatarfile: filePath },
176 statusCodeExpected: 200
177 })
178} 164}
179 165
180function updateUser (options: { 166function updateUser (options: {