From 7e8c65fb33e4379821f795889e3d39d329b18d52 Mon Sep 17 00:00:00 2001 From: Jake Date: Thu, 16 Jul 2015 17:31:20 -0500 Subject: [PATCH] Add tests for invalid URL paths, closes #123 --- test/test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test.js b/test/test.js index 89eb0c9..8d94f58 100644 --- a/test/test.js +++ b/test/test.js @@ -858,6 +858,14 @@ describe("Crafatar", function() { done(); }); }); + + it("should return a 422 (invalid request path " + location + ")", function(done) { + request.get("http://localhost:3000/" + location + "/thisisaninvaliduuid/invalid", function(error, res, body) { + assert.ifError(error); + assert.strictEqual(res.statusCode, 422); + done(); + }); + }); }(loc)); }