Skip to content
Myr

added failing test for #682

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 d1bfe13 · Browse files · 1 file+30 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+30 added−1 removed

  • tests:+30 added−1 removed

1 file+30 added−1 removed

modified:test/router.test.js+30 added-1 removed
136 unmodified lines
137 { url: '/user/ab' },138 { body: 'Cannot GET /user/ab' });139 },140 141 'test .param()': function(){141 'test app.param()': function(){142 var app = express.createServer();143144 var users = [145 { name: 'tj' }
22 unmodified lines
168 assert.response(app,169 { url: '/user/1' },170 { body: 'user tobi' });171 },172173 'test app.param() optional execution': function(beforeExit){174 var app = express.createServer()175 , calls = 0;176177 var months = ['Jan', 'Feb', 'Mar'];178179 app.param('month', function(req, res, next, n){180 req.params.month = months[n];181 ++calls;182 next();183 });184185 app.get('/calendar/:month?', function(req, res, next){186 res.send(req.params.month || months[0]);187 });188189 assert.response(app,190 { url: '/calendar' },191 { body: 'Jan' });192193 assert.response(app,194 { url: '/calendar/1' },195 { body: 'Feb' });196197 beforeExit(function(){198 calls.should.equal(1);199 });200 },201 202 'test OPTIONS': function(){203 var app = express.createServer();204
159 unmodified lines