From ebdb612458877465717bc669b40612fa833ff0c9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 25 Sep 2018 16:22:48 +0200 Subject: Fix redundancy totalVideos stats --- server/tests/utils/requests/requests.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server/tests/utils/requests') diff --git a/server/tests/utils/requests/requests.ts b/server/tests/utils/requests/requests.ts index fc7b38b8c..27a529eda 100644 --- a/server/tests/utils/requests/requests.ts +++ b/server/tests/utils/requests/requests.ts @@ -7,20 +7,20 @@ function makeGetRequest (options: { path: string, query?: any, token?: string, - statusCodeExpected?: number + statusCodeExpected?: number, + contentType?: string }) { if (!options.statusCodeExpected) options.statusCodeExpected = 400 + if (options.contentType === undefined) options.contentType = 'application/json' const req = request(options.url) .get(options.path) - .set('Accept', 'application/json') + if (options.contentType) req.set('Accept', options.contentType) if (options.token) req.set('Authorization', 'Bearer ' + options.token) if (options.query) req.query(options.query) - return req - .expect('Content-Type', /json/) - .expect(options.statusCodeExpected) + return req.expect(options.statusCodeExpected) } function makeDeleteRequest (options: { -- cgit v1.2.3