Skip to content
Myr

tests for *

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 730a419 · Browse files · 1 file+50 added−0 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+50 added−0 removed

  • tests:+50 added−0 removed

1 file+50 added−0 removed

modified:test/app.router.js+50 added
203 unmodified lines
204 })205 })206 })207208 describe('*', function(){209 it('should denote a greedy capture group', function(done){210 var app = express();211212 app.get('/user/*', function(req, res){213 res.end(req.params[0]);214 });215216 request(app)217 .get('/user/tj')218 .expect('tj', done);219 })220 221 it('should span multiple segments', function(done){222 var app = express();223224 app.get('/file/*', function(req, res){225 res.end(req.params[0]);226 });227228 request(app)229 .get('/file/javascripts/jquery.js')230 .expect('javascripts/jquery.js', done);231 })232 233 it('should be optional', function(done){234 var app = express();235236 app.get('/file/*', function(req, res){237 res.end(req.params[0]);238 });239240 request(app)241 .get('/file/')242 .expect('', done);243 })244 245 it('should require a preceeding /', function(done){246 var app = express();247248 app.get('/file/*', function(req, res){249 res.end(req.params[0]);250 });251252 request(app)253 .get('/file')254 .expect(404, done);255 })256 })257258 describe(':name', function(){259 it('should denote a capture group', function(done){260 var app = express();261
62 unmodified lines