From 7bf25f232569aa62edf1c88e7014a9f3c1b37014 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 20 Jul 2017 18:08:12 +0200 Subject: feat: Create feed handler for root --- test/app.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test') diff --git a/test/app.test.js b/test/app.test.js index f0ab3da..33c8905 100644 --- a/test/app.test.js +++ b/test/app.test.js @@ -169,5 +169,18 @@ test("highlight css", async function(t) { t.regex(res.text, /^\.hljs/m); }); +test("feed", async function(t) { + const res = await request(app.listen()).get("/index.xml"); + + t.is(res.statusCode, 200); + t.is(res.type, "application/atom+xml"); + t.regex(res.text, /^<\?xml/); + + const $ = parseResponse(res); + + t.is($("feed > title").text(), "John Doe"); + t.is($("feed > link").attr("href"), "http://localhost:3000/"); +}); + test(notFound, "/post/non-existent", /Post not found/); test(notFound, "/tag/non-existent", /tag non-existent not found/); -- cgit 1.4.1