mirror of
https://github.com/zebrajr/express.git
synced 2026-01-15 12:15:27 +00:00
Added res.render() absolute path tests
This commit is contained in:
@@ -4,6 +4,41 @@ var express = require('../')
|
||||
|
||||
describe('res', function(){
|
||||
describe('.render(name)', function(){
|
||||
it('should support absolute paths', function(done){
|
||||
var app = express();
|
||||
|
||||
app.locals.user = { name: 'tobi' };
|
||||
|
||||
app.use(function(req, res){
|
||||
res.render(__dirname + '/fixtures/user.jade');
|
||||
});
|
||||
|
||||
request(app)
|
||||
.get('/')
|
||||
.end(function(res){
|
||||
res.body.should.equal('<p>tobi</p>');
|
||||
done();
|
||||
});
|
||||
})
|
||||
|
||||
it('should support absolute paths with "view engine"', function(done){
|
||||
var app = express();
|
||||
|
||||
app.locals.user = { name: 'tobi' };
|
||||
app.set('view engine', 'jade');
|
||||
|
||||
app.use(function(req, res){
|
||||
res.render(__dirname + '/fixtures/user');
|
||||
});
|
||||
|
||||
request(app)
|
||||
.get('/')
|
||||
.end(function(res){
|
||||
res.body.should.equal('<p>tobi</p>');
|
||||
done();
|
||||
});
|
||||
})
|
||||
|
||||
it('should expose app.locals', function(done){
|
||||
var app = express();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user