Skip to content
Myr

Added res.render() callback with locals 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 9bfeae2 · Browse files · 1 file+24 added−1 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+24 added−1 removed

  • tests:+24 added−1 removed

1 file+24 added−1 removed

modified:test/res.render.js+24 added-1 removed
196 unmodified lines
197 });198 })199 })200201 describe('.render(name, options, fn)', function(){202 it('should pass the resulting string', function(done){203 var app = express();204205 app.set('views', __dirname + '/fixtures');206207 app.use(function(req, res){208 var tobi = { name: 'tobi' };209 res.render('user.jade', { user: tobi }, function(err, html){210 html = html.replace('tobi', 'loki');211 res.end(html);212 });213 });214215 request(app)216 .get('/')217 .end(function(res){218 res.body.should.equal('<p>loki</p>');219 done();220 });221 })222 })223224 describe('.render(name, fn)', function(){202 it('should not respond', function(done){225 it('should pass the resulting string', function(done){226 var app = express();227228 app.set('views', __dirname + '/fixtures');229
38 unmodified lines