From 2d0af06122d276d995e77feddda5fbe633a8025d Mon Sep 17 00:00:00 2001 From: Jake Date: Mon, 9 Feb 2015 22:12:33 -0600 Subject: [PATCH] Test default images on all paths --- test/test.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/test/test.js b/test/test.js index a451bcd..47bb959 100644 --- a/test/test.js +++ b/test/test.js @@ -225,19 +225,23 @@ describe("Server", function() { }); }); - it("should return a 404 (default steve image)", function(done) { - request.get('http://localhost:3000/avatars/invalidjsvns?default=steve', function(error, res, body) { - assert.equal(404, res.statusCode); - done(); + locations = ["avatars", "capes", "skins"] + for (var l in locations) { + var location = locations[l]; + it("should return a 404 (default steve image " + location + ")", function(done) { + request.get('http://localhost:3000/' + location + '/invalidjsvns?default=steve', function(error, res, body) { + assert.equal(404, res.statusCode); + done(); + }); }); - }); - it("should return a 200 (default external image)", function(done) { - request.get('http://localhost:3000/avatars/invalidjsvns?default=https%3A%2F%2Fi.imgur.com%2FocJVWAc.png', function(error, res, body) { - assert.equal(200, res.statusCode); - done(); + it("should return a 200 (default external image " + location + ")", function(done) { + request.get('http://localhost:3000/' + location + '/invalidjsvns?default=https%3A%2F%2Fi.imgur.com%2FocJVWAc.png', function(error, res, body) { + assert.equal(200, res.statusCode); + done(); + }); }); - }); + } it("should return a 404 (no cape)", function(done) { request.get('http://localhost:3000/capes/Jake0oo0', function(error, res, body) {