From f37dc0dd14d9ce0b59c454c2c1b935fcbe9727e9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 23 Aug 2018 17:58:39 +0200 Subject: Add ability to search video channels --- .../tests/api/check-params/user-subscriptions.ts | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'server/tests/api/check-params/user-subscriptions.ts') diff --git a/server/tests/api/check-params/user-subscriptions.ts b/server/tests/api/check-params/user-subscriptions.ts index 6a6dd9a6f..9fba99ac8 100644 --- a/server/tests/api/check-params/user-subscriptions.ts +++ b/server/tests/api/check-params/user-subscriptions.ts @@ -202,6 +202,46 @@ describe('Test user subscriptions API validators', function () { }) }) + describe('When checking if subscriptions exist', async function () { + const existPath = path + '/exist' + + it('Should fail with a non authenticated user', async function () { + await makeGetRequest({ + url: server.url, + path: existPath, + statusCodeExpected: 401 + }) + }) + + it('Should fail with bad URIs', async function () { + await makeGetRequest({ + url: server.url, + path: existPath, + query: { uris: 'toto' }, + token: server.accessToken, + statusCodeExpected: 400 + }) + + await makeGetRequest({ + url: server.url, + path: existPath, + query: { 'uris[]': 1 }, + token: server.accessToken, + statusCodeExpected: 400 + }) + }) + + it('Should succeed with the correct parameters', async function () { + await makeGetRequest({ + url: server.url, + path: existPath, + query: { 'uris[]': 'coucou@localhost:9001' }, + token: server.accessToken, + statusCodeExpected: 200 + }) + }) + }) + describe('When removing a subscription', function () { it('Should fail with a non authenticated user', async function () { await makeDeleteRequest({ -- cgit v1.2.3