about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2017-06-24 22:25:53 +0200
committerAlan Pearce2017-06-24 22:25:53 +0200
commitab881e671747b3b1826524bb71ccb615254e3c4f (patch)
tree4ab34a62332045e1ae0cad2ee76ac2dd76294398
parentbfa5ccaec4cb601836c47a43faf6ac79f018b81b (diff)
downloadhomestead-ab881e671747b3b1826524bb71ccb615254e3c4f.tar.lz
homestead-ab881e671747b3b1826524bb71ccb615254e3c4f.tar.zst
homestead-ab881e671747b3b1826524bb71ccb615254e3c4f.zip
test: ensure 404s work
-rw-r--r--test/app.test.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/app.test.js b/test/app.test.js
index 04596fa..a054366 100644
--- a/test/app.test.js
+++ b/test/app.test.js
@@ -25,6 +25,14 @@ test('post', t => {
     .then(() => t.pass())
 })
 
+test('post not found', t => {
+  return request(app.listen())
+    .get('/post/non-existant')
+    .expect(404)
+    .expect(/Post not found/)
+    .then(() => t.pass())
+})
+
 test('tags', t => {
   return request(app.listen())
     .get('/tag/a')
@@ -32,3 +40,10 @@ test('tags', t => {
     .expect(/This is a test/)
     .then(() => t.pass())
 })
+
+test('tags not found', t =>
+  request(app.listen())
+    .get('/tag/non-existant')
+    .expect(404)
+    .expect(/tag non-existant not found/)
+    .then(() => t.pass()))