aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/feeds/feeds.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2018-04-18 16:08:36 +0200
committerChocobozzz <me@florianbigard.com>2018-04-26 16:30:27 +0200
commit966eb053131b052e7fc3b3b3adaf2d27ff05d7a3 (patch)
tree885e4e483a0e91f5c106024513cdc3ead6177e63 /server/tests/utils/feeds/feeds.ts
parent08c1efbe32244c321de28b0f2a6aaa3f99f46b58 (diff)
downloadPeerTube-966eb053131b052e7fc3b3b3adaf2d27ff05d7a3.tar.gz
PeerTube-966eb053131b052e7fc3b3b3adaf2d27ff05d7a3.tar.zst
PeerTube-966eb053131b052e7fc3b3b3adaf2d27ff05d7a3.zip
feature: initial syndication feeds tests for instance-wide feeds
Diffstat (limited to 'server/tests/utils/feeds/feeds.ts')
-rw-r--r--server/tests/utils/feeds/feeds.ts30
1 files changed, 30 insertions, 0 deletions
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 @@
1import * as request from 'supertest'
2import { readFileBufferPromise } from '../../../helpers/core-utils'
3
4function getXMLfeed (url: string, format?: string) {
5 const path = '/feeds/videos.xml'
6
7 return request(url)
8 .get(path)
9 .query((format) ? { format: format } : {})
10 .set('Accept', 'application/xml')
11 .expect(200)
12 .expect('Content-Type', /xml/)
13}
14
15function getJSONfeed (url: string) {
16 const path = '/feeds/videos.json'
17
18 return request(url)
19 .get(path)
20 .set('Accept', 'application/json')
21 .expect(200)
22 .expect('Content-Type', /json/)
23}
24
25// ---------------------------------------------------------------------------
26
27export {
28 getXMLfeed,
29 getJSONfeed
30}