Skip to content
Myr

Fixed "partials" setting

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 58b46ff · Browse files · 3 files+22 added−1 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+22 added−1 removed

  • tests:+19 added−0 removed
  • other:+3 added−1 removed

3 files+22 added−1 removed

modified:lib/express/view.js+3 added-1 removed
188 unmodified lines
189 }190191 // Partials support192 if (options.partial) {193 root += (typeof this.app.set('partials') === 'string') ? this.app.set('partials') : '/partials';193 root = this.app.set('partials')194 ? this.app.set('partials')195 : root + '/partials';196 }197198 // View path199 var path = view[0] === '/'
68 unmodified lines
added:test/fixtures/sub-templates/item.jade+1 added
1li.item= item
modified:test/view.test.js+18 added
345 unmodified lines
346 347 assert.response(app,348 { url: '/nothing' },349 { body: 'Hello' });350 },351 352 'test "partials" setting': function(assert){353 var app = create();354 app.set('partials', __dirname + '/fixtures/sub-templates');355356 app.get('/', function(req, res){357 res.render('items.jade', {358 layout: false,359 locals: {360 items: ['foo', 'bar']361 }362 });363 });364 365 assert.response(app,366 { url: '/' },367 { body: '<ul><li class="item">foo</li><li class="item">bar</li></ul>' });368 }369};