aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/user-subscriptions.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-17 15:45:42 +0200
committerChocobozzz <me@florianbigard.com>2018-08-27 09:41:54 +0200
commit8a19bee1a1ee39f973bb37429e4f73c3f2873cdb (patch)
tree33c93ef19451d7e46d4be74ce0681359d2dcc70e /server/tests/api/check-params/user-subscriptions.ts
parent965c4b22d0e4d2f853501e844e6ebbb861bd389d (diff)
downloadPeerTube-8a19bee1a1ee39f973bb37429e4f73c3f2873cdb.tar.gz
PeerTube-8a19bee1a1ee39f973bb37429e4f73c3f2873cdb.tar.zst
PeerTube-8a19bee1a1ee39f973bb37429e4f73c3f2873cdb.zip
Add ability to set a name to a channel
Diffstat (limited to 'server/tests/api/check-params/user-subscriptions.ts')
-rw-r--r--server/tests/api/check-params/user-subscriptions.ts19
1 files changed, 6 insertions, 13 deletions
diff --git a/server/tests/api/check-params/user-subscriptions.ts b/server/tests/api/check-params/user-subscriptions.ts
index 9f7d15b27..628a74476 100644
--- a/server/tests/api/check-params/user-subscriptions.ts
+++ b/server/tests/api/check-params/user-subscriptions.ts
@@ -5,7 +5,6 @@ import 'mocha'
5import { 5import {
6 createUser, 6 createUser,
7 flushTests, 7 flushTests,
8 getMyUserInformation,
9 killallServers, 8 killallServers,
10 makeDeleteRequest, 9 makeDeleteRequest,
11 makeGetRequest, 10 makeGetRequest,
@@ -21,7 +20,6 @@ describe('Test user subscriptions API validators', function () {
21 const path = '/api/v1/users/me/subscriptions' 20 const path = '/api/v1/users/me/subscriptions'
22 let server: ServerInfo 21 let server: ServerInfo
23 let userAccessToken = '' 22 let userAccessToken = ''
24 let userChannelUUID: string
25 23
26 // --------------------------------------------------------------- 24 // ---------------------------------------------------------------
27 25
@@ -40,11 +38,6 @@ describe('Test user subscriptions API validators', function () {
40 } 38 }
41 await createUser(server.url, server.accessToken, user.username, user.password) 39 await createUser(server.url, server.accessToken, user.username, user.password)
42 userAccessToken = await userLogin(server, user) 40 userAccessToken = await userLogin(server, user)
43
44 {
45 const res = await getMyUserInformation(server.url, server.accessToken)
46 userChannelUUID = res.body.videoChannels[ 0 ].uuid
47 }
48 }) 41 })
49 42
50 describe('When listing my subscriptions', function () { 43 describe('When listing my subscriptions', function () {
@@ -69,7 +62,7 @@ describe('Test user subscriptions API validators', function () {
69 }) 62 })
70 63
71 it('Should success with the correct parameters', async function () { 64 it('Should success with the correct parameters', async function () {
72 await await makeGetRequest({ 65 await makeGetRequest({
73 url: server.url, 66 url: server.url,
74 path, 67 path,
75 token: userAccessToken, 68 token: userAccessToken,
@@ -102,7 +95,7 @@ describe('Test user subscriptions API validators', function () {
102 }) 95 })
103 96
104 it('Should success with the correct parameters', async function () { 97 it('Should success with the correct parameters', async function () {
105 await await makeGetRequest({ 98 await makeGetRequest({
106 url: server.url, 99 url: server.url,
107 path, 100 path,
108 token: userAccessToken, 101 token: userAccessToken,
@@ -116,7 +109,7 @@ describe('Test user subscriptions API validators', function () {
116 await makePostBodyRequest({ 109 await makePostBodyRequest({
117 url: server.url, 110 url: server.url,
118 path, 111 path,
119 fields: { uri: userChannelUUID + '@localhost:9001' }, 112 fields: { uri: 'user1_channel@localhost:9001' },
120 statusCodeExpected: 401 113 statusCodeExpected: 401
121 }) 114 })
122 }) 115 })
@@ -152,7 +145,7 @@ describe('Test user subscriptions API validators', function () {
152 url: server.url, 145 url: server.url,
153 path, 146 path,
154 token: server.accessToken, 147 token: server.accessToken,
155 fields: { uri: userChannelUUID + '@localhost:9001' }, 148 fields: { uri: 'user1_channel@localhost:9001' },
156 statusCodeExpected: 204 149 statusCodeExpected: 204
157 }) 150 })
158 }) 151 })
@@ -162,7 +155,7 @@ describe('Test user subscriptions API validators', function () {
162 it('Should fail with a non authenticated user', async function () { 155 it('Should fail with a non authenticated user', async function () {
163 await makeDeleteRequest({ 156 await makeDeleteRequest({
164 url: server.url, 157 url: server.url,
165 path: path + '/' + userChannelUUID + '@localhost:9001', 158 path: path + '/user1_channel@localhost:9001',
166 statusCodeExpected: 401 159 statusCodeExpected: 401
167 }) 160 })
168 }) 161 })
@@ -202,7 +195,7 @@ describe('Test user subscriptions API validators', function () {
202 it('Should success with the correct parameters', async function () { 195 it('Should success with the correct parameters', async function () {
203 await makeDeleteRequest({ 196 await makeDeleteRequest({
204 url: server.url, 197 url: server.url,
205 path: path + '/' + userChannelUUID + '@localhost:9001', 198 path: path + '/user1_channel@localhost:9001',
206 token: server.accessToken, 199 token: server.accessToken,
207 statusCodeExpected: 204 200 statusCodeExpected: 204
208 }) 201 })