Permalink
Browse files

Merge pull request #47 from edwardhotchkiss/master

0.4.3
  • Loading branch information...
2 parents e7e93af + 5fb085f commit 7cf1450ea85f9af07ed1e381ec4f311858d4d9dc Edward Hotchkiss committed Nov 26, 2011
Showing with 7 additions and 34 deletions.
  1. +4 −6 templates/app.js
  2. +3 −3 test/index.test.js
  3. +0 −25 test/templates.test.js
View
@@ -8,7 +8,7 @@
// load dependencies
var mongoose = require("mongoose");
-var blueprint = require("blueprint");
+var blueprint = require("../lib/blueprint");
// http.createServer()
var app = blueprint.createServer();
@@ -23,7 +23,7 @@ blueprint.load("controllers");
// connect to mongodb via mongoose
mongoose.connect(blueprint.conf.get("mongodb"));
-// listen for a mongodb error
+// mongoose listeners
mongoose.connection.on("error", function(error) {
throw new Error(error);
});
@@ -33,9 +33,7 @@ app.get("/", false, function(request, response) {
response.send("don't taze me bro!");
});
-// wait for mongodb state to be ready, then boot
-mongoose.connection.on("open", function() {
- app.listen(8000);
-});
+// http.Server.listen()
+app.listen(8000);
/* EOF */
View
@@ -21,8 +21,8 @@ vows.describe("General Module Tests").addBatch({
app.get("/", false, function(request, response) {
response.send({message:"don't taze me bro!"});
});
- app.listen(8000);
- request("http://localhost:8000/", this.callback);
+ app.listen(9000);
+ request("http://localhost:9000/", this.callback);
},
"we should be able to make a request and get back text/html, a 200 response code":function(error, response, body){
assert.equal(error, null);
@@ -32,7 +32,7 @@ vows.describe("General Module Tests").addBatch({
},
"when we serve up a non existing route":{
topic:function(){
- request("http://localhost:8000/fake-stuff/", this.callback);
+ request("http://localhost:9000/fake-stuff/", this.callback);
},
"we should be able to make a request and get back text/html, with a 404 response code":function(error, response, body){
assert.equal(error, null);
View
@@ -1,25 +0,0 @@
-
-var vows = require("vows");
-var assert = require("assert");
-var should = require("should");
-var request = require("request");
-
-var blueprint = require("../lib/blueprint");
-
-vows.describe("Template Tests").addBatch({
- "when spawning a child process for /templates/app.js":{
- topic:function(){
- var app = blueprint.createServer();
- app.get("/", false, function(request, response) {
- response.send("don't taze me bro!");
- })
- app.listen(8001);
- request("http://localhost:8001/", this.callback);
- },
- "blueprint.scaffold should be a function":function(error, response, body){
- assert.equal(error, null);
- }
- }
-}).export(module);
-
-/* EOF */

0 comments on commit 7cf1450

Please sign in to comment.