Răsfoiți Sursa

Test valid inputs for all paths

Jake 10 ani în urmă
părinte
comite
c925082f7f
2 a modificat fișierele cu 8 adăugiri și 1 ștergeri
  1. 1 1
      server.js
  2. 7 0
      test/test.js

+ 1 - 1
server.js

@@ -92,7 +92,7 @@ var exp = {};
 exp.boot = function(callback) {
   var port = process.env.PORT || 3000;
   var bind_ip = process.env.BIND || "127.0.0.1";
-  console.log("Server running on http://" + bind_ip + ":" + port + "/");
+  logging.log("Server running on http://" + bind_ip + ":" + port + "/");
   server = http.createServer(requestHandler).listen(port, bind_ip, function() {
     callback();
   });

+ 7 - 0
test/test.js

@@ -246,6 +246,13 @@ describe("Server", function() {
           done();
         });
       });
+
+      it("should return a 200 (valid input)", function(done) {
+        request.get("http://localhost:3000/" + location + "/Jake0oo0", function(error, res, body) {
+          assert.equal(200, res.statusCode);
+          done();
+        });
+      });
     }
 
     // testing all paths for default images