Skip to content

Commit 5ee905d

Browse files
committed
Add asserts, use httpyac
1 parent 0cf0f8d commit 5ee905d

2 files changed

Lines changed: 41 additions & 2 deletions

File tree

.github/workflows/build-and-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
run: |
3939
docker compose up --no-build --pull never -d
4040
sleep 5s
41-
npx rest-cli calls.http --show headers
41+
npx -y httpyac calls.http --all --output short --output-failed exchange
4242
docker compose down
4343
- name: Build all images
4444
run: |

calls.http

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,54 @@
22

33
### Index page
44
GET {{baseUrl}}/index.php
5+
?? status == 200
6+
{{
7+
test.hasResponseBody();
8+
const assert = require('assert');
9+
test('response body has expected title', () => {
10+
assert(response.body.includes("<title>Full-Text RSS Feeds | from fivefilters.org</title>"));
11+
});
12+
}}
513

614

715
### Extract feed with max 1 article
816
GET {{baseUrl}}/makefulltextfeed.php
917
?url=sec%3A%2F%2Fwww.tagesschau.de%2Findex~rss2.xml
1018
&max=1
1119
&links=preserve
20+
?? status == 200
21+
{{
22+
test.hasResponseBody();
23+
const assert = require('assert');
24+
test('response body has expected content', () => {
25+
assert(response.body.includes("<link>https://www.tagesschau.de/</link>"));
26+
assert(response.body.includes('<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">'));
27+
});
28+
}}
29+
1230

1331
### Extract article without images
1432
GET {{baseUrl}}/extract.php
15-
?url=https://en.wikipedia.org/wiki/Vincent_van_Gogh
33+
?url=https://www.tagesschau.de
1634
&images=0
35+
?? status == 200
36+
?? body title exists
37+
?? body excerpt exists
38+
?? body date exists
39+
?? body author exists
40+
?? body language exists
41+
?? body url exists
42+
?? body effective_url exists
43+
?? body domain exists
44+
?? body word_count exists
45+
?? body og_url exists
46+
?? body og_title exists
47+
?? body og_description exists
48+
?? body og_image exists
49+
?? body og_type exists
50+
?? body twitter_card exists
51+
?? body twitter_site exists
52+
?? body twitter_creator exists
53+
?? body twitter_title exists
54+
?? body twitter_description exists
55+
?? body content exists

0 commit comments

Comments
 (0)