Skip to content
Myr

added more local 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 89299d7 · Browse files · 1 file+26 added−4 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+26 added−4 removed

  • tests:+26 added−4 removed

1 file+26 added−4 removed

modified:test/view.test.js+26 added-4 removed
842 unmodified lines
843 844 app.set('view options', {845 layout: false846 , open: '<?'847 , title: 'Should not show :)'847 , title: 'Original'848 });849 850 app.get('/video', function(req, res, next){851 res.local('close', '?>')849850 function setTitle(req, res, next) {851 res.local('title', 'Wahoo');852 next();853 }854855 app.get('/video', setTitle, function(req, res, next){856 res.local('close', '?>')857 res.render('video.ejs', { layout: false, title: 'keyboard cat' });858 });859 860 app.get('/video/2', setTitle, function(req, res, next){861 res.local('close', '?>')862 res.render('video.ejs', { layout: false });863 });864865 app.get('/video/3', function(req, res, next){866 res.local('close', '?>')867 res.render('video.ejs', { layout: false });868 });869870 assert.response(app,871 { url: '/video' },872 { body: '<h1>keyboard cat</h1>' });873874 assert.response(app,875 { url: '/video/2' },876 { body: '<h1>Wahoo</h1>' });877878 assert.response(app,879 { url: '/video/3' },880 { body: '<h1>Original</h1>' });881 },882 883 'test res.local() partials': function(){884 var app = create();
41 unmodified lines