From 1f71fae23be00f44bdfef212cc16868dd8cd5954 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Sun, 26 Feb 2017 13:21:18 -0500 Subject: [PATCH] tests: add lone "*" route tests --- test/app.router.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/app.router.js b/test/app.router.js index 301f9b86af..1bba62e270 100644 --- a/test/app.router.js +++ b/test/app.router.js @@ -563,6 +563,30 @@ describe('app.router', function(){ }) describe('*', function(){ + it('should capture everything', function (done) { + var app = express() + + app.get('*', function (req, res) { + res.end(req.params[0]) + }) + + request(app) + .get('/user/tobi.json') + .expect('/user/tobi.json', done) + }) + + it('should decore the capture', function (done) { + var app = express() + + app.get('*', function (req, res) { + res.end(req.params[0]) + }) + + request(app) + .get('/user/tobi%20and%20loki.json') + .expect('/user/tobi and loki.json', done) + }) + it('should denote a greedy capture group', function(done){ var app = express();