Skip to content
Myr

Merge branch 'fix-middleware'

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 · parents 656e67e, 0550755 · Browse files · 2 files+25 added−3 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+25 added−3 removed

  • tests:+20 added−0 removed
  • other:+5 added−3 removed

2 files+25 added−3 removed

modified:lib/express/server.js+5 added-3 removed
modified:test/express.test.js+20 added
199 unmodified lines
200 var app = express.createServer();201 var ret = app.disable('some feature');202 assert.equal(app, ret, 'Test #disable() returns server for chaining');203 assert.strictEqual(false, app.set('some feature'));204 },205 206 'test middleware precedence': function(assert){207 var app = express.createServer();208 209 app.use(connect.bodyDecoder());210211 assert.equal(2, app.stack.length);212 213 app.post('/', function(req, res){214 res.send(JSON.stringify(req.body || ''));215 });216 app.get('/', function(){217 218 });219 assert.equal(3, app.stack.length);220221 assert.response(app,222 { url: '/', method: 'POST', data: 'name=tj', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }},223 { body: '{"name":"tj"}' });224 }225};