Skip to content
Myr

Removed "status" and "charset" options

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 4a5776b · Browse files · 2 files+0 added−46 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+0 added−46 removed

  • tests:+0 added−40 removed
  • other:+0 added−6 removed

2 files+0 added−46 removed

modified:lib/response.js-6 removed
512 unmodified lines
513 function render() {514 // merge res.locals515 options.locals = self.locals;516517 // status option518 if (options.status) self.statusCode = options.status;519520 // charset option521 if (options.charset) self.charset = options.charset;522517 // default callback to respond518 fn = fn || function(err, str){519 if (err) return req.next(err);520 self.send(str);
30 unmodified lines
modified:test/res.render.js-40 removed
287 unmodified lines
288 })289 })290 })291 })292 293 describe('"status" options', function(){294 it('should set the .statusCode', function(done){295 var app = express();296297 app.set('views', __dirname + '/fixtures');298299 app.use(function(req, res){300 res.render('email.jade', { status: 202 });301 });302303 request(app)304 .get('/')305 .end(function(res){306 res.statusCode.should.equal(202);307 res.body.should.equal('<p>This is an email</p>');308 done();309 });310 })311 })312 313 describe('"charset" options', function(){314 it('should set the .charset', function(done){315 var app = express();316317 app.set('views', __dirname + '/fixtures');318319 app.use(function(req, res){320 res.render('email.jade', { charset: 'foobar' });321 });322323 request(app)324 .get('/')325 .end(function(res){326 res.headers['content-type'].should.equal('text/html; charset=foobar');327 res.body.should.equal('<p>This is an email</p>');328 done();329 });330 })331 })292})