Permalink
Browse files

Update test/express-expose.test.js

add one test to check javascript is exposed in views 
  • Loading branch information...
1 parent 583bdde commit b3c04a35c210fcf75d62c94ee04a1e93f8e93c14 @pgherveou pgherveou committed Aug 7, 2012
Showing with 14 additions and 1 deletion.
  1. +14 −1 test/express-expose.test.js
View
15 test/express-expose.test.js
@@ -1,4 +1,3 @@
-
/**
* Module dependencies.
*/
@@ -132,5 +131,19 @@ module.exports = {
vm.runInNewContext(js, scope);
scope.sub(8,7).should.equal(1);
scope.should.not.have.property('add');
+ },
+
+ 'test render view' : function (done) {
+ var app = express();
+
+ app.expose('var foo;');
+ app.set('view engine', 'jade');
+ app.set('views', __dirname + '/views');
+
+ app.render('index', function(err, str){
+ if (err) return done(err);
+ str.should.match(/var foo;/);
+ done();
+ });
}
};

0 comments on commit b3c04a3

Please sign in to comment.