Skip to content
Myr

Added test to confirm res.render() callback with layouts

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 f088830 · Browse files · 2 files+10 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

2 files+10 added−0 removed

  • tests:+10 added−0 removed

2 files+10 added−0 removed

added:test/fixtures/hello.jade+1 added
1p :(
modified:test/view.test.js+9 added
25 unmodified lines
26 });27 app.get('/haml', function(req, res){28 res.render('hello.haml', { layout: false });29 });30 app.get('/callback/layout', function(req, res){31 res.render('hello.jade', {}, function(err, str){32 assert.ok(!err);33 res.send(str.replace(':(', ':)'));34 });35 });36 app.get('/callback', function(req, res){37 res.render('hello.haml', { layout: false }, function(err, str){38 assert.ok(!err);39 res.send(str.replace('Hello World', ':)'));
31 unmodified lines
71 assert.response(app,72 { url: '/callback' },73 { body: '\n<p>:)</p>' });74 assert.response(app,75 { url: '/callback/layout' },76 { body: '<html><body><p>:)</p></body></html>' });77 assert.response(app,78 { url: '/error' },79 { body: 'doesNotExist' });80 assert.response(app,81 { url: '/invalid' },
354 unmodified lines