Skip to content
Myr

precedence 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 8c56df7 · Browse files · 1 file+40 added−9 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+40 added−9 removed

  • tests:+40 added−9 removed

1 file+40 added−9 removed

modified:test/view.test.js+40 added-9 removed
923 unmodified lines
924 { url: '/video' },925 { body: '<h1>Wahoo</h1>' });926 },927 928 'test res.locals render() precedence': function(){928 'test app.locals / res.locals precedence': function(){929 var app = create();930 931 app.get('/video', function(req, res, next){930931 app.locals.title = 'App Level';932933 app.get('/render', function(req, res, next){934 res.locals.open = '<?';935 res.locals.close = '?>';934 res.locals.title = 'Wahoo';935 res.render('video.ejs', { layout: false, title: 'keyboard cat' });936 res.locals.title = 'Response Level';937 res.render('video.ejs', { layout: false, title: 'Render Level' });938 });937 939940 var app2 = create();941942 app2.locals.title = 'App Level';943944 app2.get('/response', function(req, res, next){945 res.locals.open = '<?';946 res.locals.close = '?>';947 res.locals.title = 'Response Level';948 res.render('video.ejs', { layout: false });949 });950951 var app3 = create();952953 app3.locals.title = 'App Level';954955 app3.get('/app', function(req, res, next){956 res.locals.open = '<?';957 res.locals.close = '?>';958 res.render('video.ejs', { layout: false });959 });960961 assert.response(app3,962 { url: '/app' },963 { body: '<h1>App Level</h1>' });964965 assert.response(app2,966 { url: '/response' },967 { body: '<h1>Response Level</h1>' });968969 assert.response(app,939 { url: '/video' },940 { body: '<h1>keyboard cat</h1>' });970 { url: '/render' },971 { body: '<h1>Render Level</h1>' });972 },942 973974 'test res.locals partials': function(){975 var app = create();976977 app.locals.site = 'My Cool Pets';
105 unmodified lines