Skip to content
Myr

Added res.render() absolute path tests

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent d9098c5 · Browse files · 1 file+35 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+35 added−0 removed

  • tests:+35 added−0 removed

1 file+35 added−0 removed

modified:test/res.render.js+35 added
2 unmodified lines
3 , request = require('./support/http');45describe('res', function(){6 describe('.render(name)', function(){7 it('should support absolute paths', function(done){8 var app = express();9 10 app.locals.user = { name: 'tobi' };1112 app.use(function(req, res){13 res.render(__dirname + '/fixtures/user.jade');14 });1516 request(app)17 .get('/')18 .end(function(res){19 res.body.should.equal('<p>tobi</p>');20 done();21 });22 })23 24 it('should support absolute paths with "view engine"', function(done){25 var app = express();26 27 app.locals.user = { name: 'tobi' };28 app.set('view engine', 'jade');2930 app.use(function(req, res){31 res.render(__dirname + '/fixtures/user');32 });3334 request(app)35 .get('/')36 .end(function(res){37 res.body.should.equal('<p>tobi</p>');38 done();39 });40 })4142 it('should expose app.locals', function(done){43 var app = express();44 45 app.set('views', __dirname + '/fixtures');
282 unmodified lines