+ expectedStatus: HttpStatusCode.OK_200
+ })
+ })
+ })
+
+ describe('When checking if subscriptions exist', function () {
+ const existPath = path + '/exist'
+
+ it('Should fail with a non authenticated user', async function () {
+ await makeGetRequest({
+ url: server.url,
+ path: existPath,
+ expectedStatus: HttpStatusCode.UNAUTHORIZED_401
+ })
+ })
+
+ it('Should fail with bad URIs', async function () {
+ await makeGetRequest({
+ url: server.url,
+ path: existPath,
+ query: { uris: 'toto' },
+ token: server.accessToken,
+ expectedStatus: HttpStatusCode.BAD_REQUEST_400
+ })
+
+ await makeGetRequest({
+ url: server.url,
+ path: existPath,
+ query: { 'uris[]': 1 },
+ token: server.accessToken,
+ expectedStatus: HttpStatusCode.BAD_REQUEST_400
+ })
+ })
+
+ it('Should succeed with the correct parameters', async function () {
+ await makeGetRequest({
+ url: server.url,
+ path: existPath,
+ query: { 'uris[]': 'coucou@localhost:' + server.port },
+ token: server.accessToken,
+ expectedStatus: HttpStatusCode.OK_200