Skip to content
Myr

Fixed app.render() absolute path support

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 26c62a6 · Browse files · 3 files+16 added−3 removed
This commit

State

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

Diff stats

3 files+16 added−3 removed

  • tests:+12 added−0 removed
  • other:+4 added−3 removed

3 files+16 added−3 removed

modified:lib/application.js+2 added-2 removed
569 unmodified lines
570571 // view572 if (!view) {573 view = new View(name, {574 defaultEngine: this.set('view engine')575 , root: this.set('views') || process.cwd() + '/views'574 defaultEngine: this.get('view engine')575 , root: this.get('views') || process.cwd() + '/views'576 , engines: engines577 });578579 // prime the cache
10 unmodified lines
modified:lib/view.js+2 added-1 removed
modified:test/app.render.js+12 added
1 unmodified line
2var express = require('../');34describe('app', function(){5 describe('.render(name, fn)', function(){6 it('should support absolute paths', function(done){7 var app = express();89 app.locals.user = { name: 'tobi' };1011 app.render(__dirname + '/fixtures/user.jade', function(err, str){12 if (err) return done(err);13 str.should.equal('<p>tobi</p>');14 done();15 })16 })1718 it('should expose app.locals', function(done){19 var app = express();2021 app.set('views', __dirname + '/fixtures');
111 unmodified lines