aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-29 13:18:05 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-29 13:18:05 +0100
commit86d13ec2aa94ec10810ddf9c8b33314bd4968791 (patch)
tree5c4175325362df2a92e367dc4077e53a700bfbad /server/tests/utils
parent165cdc75bf1942ed687f78094c2bd366839a7c99 (diff)
downloadPeerTube-86d13ec2aa94ec10810ddf9c8b33314bd4968791.tar.gz
PeerTube-86d13ec2aa94ec10810ddf9c8b33314bd4968791.tar.zst
PeerTube-86d13ec2aa94ec10810ddf9c8b33314bd4968791.zip
Users list only available when use is authenticated
And has a special right
Diffstat (limited to 'server/tests/utils')
-rw-r--r--server/tests/utils/users.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/tests/utils/users.ts b/server/tests/utils/users.ts
index 12569dd42..ce04b9d96 100644
--- a/server/tests/utils/users.ts
+++ b/server/tests/utils/users.ts
@@ -76,17 +76,18 @@ function getUserVideoRating (url: string, accessToken: string, videoId: number)
76 .expect('Content-Type', /json/) 76 .expect('Content-Type', /json/)
77} 77}
78 78
79function getUsersList (url: string) { 79function getUsersList (url: string, accessToken: string) {
80 const path = '/api/v1/users' 80 const path = '/api/v1/users'
81 81
82 return request(url) 82 return request(url)
83 .get(path) 83 .get(path)
84 .set('Accept', 'application/json') 84 .set('Accept', 'application/json')
85 .set('Authorization', 'Bearer ' + accessToken)
85 .expect(200) 86 .expect(200)
86 .expect('Content-Type', /json/) 87 .expect('Content-Type', /json/)
87} 88}
88 89
89function getUsersListPaginationAndSort (url: string, start: number, count: number, sort: string) { 90function getUsersListPaginationAndSort (url: string, accessToken: string, start: number, count: number, sort: string) {
90 const path = '/api/v1/users' 91 const path = '/api/v1/users'
91 92
92 return request(url) 93 return request(url)
@@ -95,6 +96,7 @@ function getUsersListPaginationAndSort (url: string, start: number, count: numbe
95 .query({ count }) 96 .query({ count })
96 .query({ sort }) 97 .query({ sort })
97 .set('Accept', 'application/json') 98 .set('Accept', 'application/json')
99 .set('Authorization', 'Bearer ' + accessToken)
98 .expect(200) 100 .expect(200)
99 .expect('Content-Type', /json/) 101 .expect('Content-Type', /json/)
100} 102}