Skip to content
Myr

param single-segment 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 25bd7d7 · Browse files · 2 files+20 added−4 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+20 added−4 removed

  • tests:+20 added−4 removed

2 files+20 added−4 removed

modified:test/support/http.js+5 added-1 removed
modified:test/app.router.js+15 added-3 removed
126 unmodified lines
127 });128129 request(app)130 .get('/user')131 .expect('Cannot GET /user', done);131 .expect(404, done);132 })133 })134 })135
49 unmodified lines
185 });186187 request(app)188 .get('/user')189 .expect('Cannot GET /user', done);189 .expect(404, done);190 })191 192 it('should fail when adding the trailing slash', function(done){193 var app = express();
5 unmodified lines
199 });200201 request(app)202 .get('/user/')203 .expect('Cannot GET /user/', done);203 .expect(404, done);204 })205 })206 })207
9 unmodified lines
217 .get('/user/tj')218 .expect('tj', done);219 })220 221 it('should match a single segment only', function(done){222 var app = express();223224 app.get('/user/:user', function(req, res){225 res.end(req.params.user);226 });227228 request(app)229 .get('/user/tj/edit')230 .expect(404, done);231 })232 233 it('should allow several capture groups', function(done){234 var app = express();235236 app.get('/user/:user/:op', function(req, res){
37 unmodified lines