Skip to content

Commit 1f71fae

Browse files
committed
tests: add lone "*" route tests
1 parent acc4a61 commit 1f71fae

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/app.router.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,30 @@ describe('app.router', function(){
563563
})
564564

565565
describe('*', function(){
566+
it('should capture everything', function (done) {
567+
var app = express()
568+
569+
app.get('*', function (req, res) {
570+
res.end(req.params[0])
571+
})
572+
573+
request(app)
574+
.get('/user/tobi.json')
575+
.expect('/user/tobi.json', done)
576+
})
577+
578+
it('should decore the capture', function (done) {
579+
var app = express()
580+
581+
app.get('*', function (req, res) {
582+
res.end(req.params[0])
583+
})
584+
585+
request(app)
586+
.get('/user/tobi%20and%20loki.json')
587+
.expect('/user/tobi and loki.json', done)
588+
})
589+
566590
it('should denote a greedy capture group', function(done){
567591
var app = express();
568592

0 commit comments

Comments
 (0)