Skip to content

Commit

Permalink
added .app test for the mounted server as well
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Mar 15, 2011
1 parent 9865a4c commit c9f5bb6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/express.test.js
Expand Up @@ -408,12 +408,19 @@ module.exports = {
},

'test .app property after returning control to parent': function() {
var app = express.createServer();
var app = express.createServer()
, blog = express.createServer();

// Mounted servers did not restore `req.app` and `res.app` when
// passing control back to parent via `out()` in `#handle()`.

app.use(express.createServer());
blog.get('/', function(req, res, next){
req.app.should.equal(blog);
res.app.should.equal(blog);
next();
});

app.use(blog);

app.use(function(req, res, next) {
res.send((res.app === app) ? 'restored' : 'not-restored');
Expand Down

0 comments on commit c9f5bb6

Please sign in to comment.