Skip to content
Myr

Merge branch 'partial-locals'

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 · parents dc45e93, 726ace4 · Browse files · 1 file+39 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+39 added−0 removed

  • tests:+39 added−0 removed

1 file+39 added−0 removed

modified:test/view.test.js+39 added
464 unmodified lines
465 { url: '/role' },466 { body: '<li>Role: admin</li><li>Role: member</li>' });467 },468 469 'test #partial() locals': function(assert){470 var app = create();471472 app.get('/', function(req, res, next){473 res.send(res.partial('pet-count.jade', {474 partial: true,475 layout: false,476 locals: {477 pets: {478 length: 5479 }480 }481 }));482 });483484 assert.response(app,485 { url: '/' },486 { body: 'We have 5 cool pets\n' });487 },488 489 'test #partial() locals with collection': function(assert){490 var app = create();491492 app.get('/', function(req, res, next){493 res.send(res.partial('pet.jade', {494 partial: true,495 layout: false,496 collection: ['Tobi', 'Jane'],497 locals: {498 site: 'Animal land'499 }500 }));501 });502503 assert.response(app,504 { url: '/' },505 { body: '<li>Tobi is the coolest of Animal land</li><li>Jane</li>' });506 },507 508 'test #partial() inheriting initial locals': function(assert){509 var app = create();510511 app.get('/pets', function(req, res, next){
129 unmodified lines