diff options
Diffstat (limited to 'server/tests/api/check-params/videos.ts')
-rw-r--r-- | server/tests/api/check-params/videos.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/server/tests/api/check-params/videos.ts b/server/tests/api/check-params/videos.ts index 4cc70f5cc..41064d2ff 100644 --- a/server/tests/api/check-params/videos.ts +++ b/server/tests/api/check-params/videos.ts | |||
@@ -28,6 +28,7 @@ describe('Test videos API validator', function () { | |||
28 | let channelId: number | 28 | let channelId: number |
29 | let channelName: string | 29 | let channelName: string |
30 | let video: VideoCreateResult | 30 | let video: VideoCreateResult |
31 | let privateVideo: VideoCreateResult | ||
31 | 32 | ||
32 | // --------------------------------------------------------------- | 33 | // --------------------------------------------------------------- |
33 | 34 | ||
@@ -49,6 +50,10 @@ describe('Test videos API validator', function () { | |||
49 | channelName = body.videoChannels[0].name | 50 | channelName = body.videoChannels[0].name |
50 | accountName = body.account.name + '@' + body.account.host | 51 | accountName = body.account.name + '@' + body.account.host |
51 | } | 52 | } |
53 | |||
54 | { | ||
55 | privateVideo = await server.videos.quickUpload({ name: 'private video', privacy: VideoPrivacy.PRIVATE }) | ||
56 | } | ||
52 | }) | 57 | }) |
53 | 58 | ||
54 | describe('When listing videos', function () { | 59 | describe('When listing videos', function () { |
@@ -783,6 +788,19 @@ describe('Test videos API validator', function () { | |||
783 | await makePutBodyRequest({ url: server.url, path: path + videoId + '/rate', token: server.accessToken, fields }) | 788 | await makePutBodyRequest({ url: server.url, path: path + videoId + '/rate', token: server.accessToken, fields }) |
784 | }) | 789 | }) |
785 | 790 | ||
791 | it('Should fail with a private video of another user', async function () { | ||
792 | const fields = { | ||
793 | rating: 'like' | ||
794 | } | ||
795 | await makePutBodyRequest({ | ||
796 | url: server.url, | ||
797 | path: path + privateVideo.uuid + '/rate', | ||
798 | token: userAccessToken, | ||
799 | fields, | ||
800 | expectedStatus: HttpStatusCode.FORBIDDEN_403 | ||
801 | }) | ||
802 | }) | ||
803 | |||
786 | it('Should succeed with the correct parameters', async function () { | 804 | it('Should succeed with the correct parameters', async function () { |
787 | const fields = { | 805 | const fields = { |
788 | rating: 'like' | 806 | rating: 'like' |