Skip to content
Myr

Added partial inheritance test

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 3914895 · Browse files · 3 files+36 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

3 files+36 added−0 removed

  • tests:+36 added−0 removed

3 files+36 added−0 removed

added:test/fixtures/partials/pet.jade+4 added
1- if (firstInCollection)2 li #{pet} is the coolest of #{site}3- else4 li= pet
added:test/fixtures/pets.jade+2 added
1h1= site2ul!= partial('pet', pets)
modified:test/view.test.js+30 added
464 unmodified lines
465 { url: '/role' },466 { body: '<li>Role: admin</li><li>Role: member</li>' });467 },468 469 'test #partial() inheriting initial locals': function(assert){470 var app = create();471472 app.get('/pets', function(req, res, next){473 res.render('pets.jade', {474 locals: {475 site: 'My Cool Pets',476 pets: ['Tobi', 'Jane', 'Bandit']477 }478 });479 });480481 var html = [482 '<html>',483 '<body>',484 '<h1>My Cool Pets</h1>',485 '<ul>',486 '<li>Tobi is the coolest of My Cool Pets</li>',487 '<li>Jane</li>',488 '<li>Bandit</li>',489 '</ul>',490 '</body>',491 '</html>'492 ].join('');493494 assert.response(app,495 { url: '/pets' },496 { body: html });497 },498 499 'test #partial() with array-like collection': function(assert){500 var app = create();501502 var movies = {
98 unmodified lines