From 966eb053131b052e7fc3b3b3adaf2d27ff05d7a3 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Wed, 18 Apr 2018 16:08:36 +0200 Subject: feature: initial syndication feeds tests for instance-wide feeds --- server/tests/utils/feeds/feeds.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 server/tests/utils/feeds/feeds.ts (limited to 'server/tests/utils/feeds/feeds.ts') diff --git a/server/tests/utils/feeds/feeds.ts b/server/tests/utils/feeds/feeds.ts new file mode 100644 index 000000000..20e68cf3d --- /dev/null +++ b/server/tests/utils/feeds/feeds.ts @@ -0,0 +1,30 @@ +import * as request from 'supertest' +import { readFileBufferPromise } from '../../../helpers/core-utils' + +function getXMLfeed (url: string, format?: string) { + const path = '/feeds/videos.xml' + + return request(url) + .get(path) + .query((format) ? { format: format } : {}) + .set('Accept', 'application/xml') + .expect(200) + .expect('Content-Type', /xml/) +} + +function getJSONfeed (url: string) { + const path = '/feeds/videos.json' + + return request(url) + .get(path) + .set('Accept', 'application/json') + .expect(200) + .expect('Content-Type', /json/) +} + +// --------------------------------------------------------------------------- + +export { + getXMLfeed, + getJSONfeed +} -- cgit v1.2.3