mirror of
https://github.com/zebrajr/express.git
synced 2026-01-15 12:15:27 +00:00
Added error in res.render() callback test
This commit is contained in:
@@ -262,6 +262,31 @@ describe('res', function(){
|
||||
done();
|
||||
});
|
||||
})
|
||||
|
||||
describe('in the callback', function(){
|
||||
it('should next(err)', function(done){
|
||||
var app = express();
|
||||
|
||||
app.set('views', __dirname + '/fixtures');
|
||||
|
||||
app.use(function(req, res){
|
||||
res.render('user.jade', function(err){
|
||||
req.foo();
|
||||
});
|
||||
});
|
||||
|
||||
app.use(function(err, req, res, next){
|
||||
res.end(err.message);
|
||||
});
|
||||
|
||||
request(app)
|
||||
.get('/')
|
||||
.end(function(res){
|
||||
res.body.should.match(/has no method 'foo'/);
|
||||
done();
|
||||
});
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user