about summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
authorAlan Pearce2017-07-20 18:08:12 +0200
committerAlan Pearce2017-07-20 18:08:12 +0200
commit7bf25f232569aa62edf1c88e7014a9f3c1b37014 (patch)
tree7d7d40cfa295c405427cb3bc859757b1effb0e71 /test
parenta62fb1e7584ffa53a256ff8ce4d6a451ca542f20 (diff)
downloadhomestead-7bf25f232569aa62edf1c88e7014a9f3c1b37014.tar.lz
homestead-7bf25f232569aa62edf1c88e7014a9f3c1b37014.tar.zst
homestead-7bf25f232569aa62edf1c88e7014a9f3c1b37014.zip
feat: Create feed handler for root
Diffstat (limited to 'test')
-rw-r--r--test/app.test.js13
1 files changed, 13 insertions, 0 deletions
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/);