Skip to content

Commit

Permalink
tests: add lone "*" route tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Feb 26, 2017
1 parent acc4a61 commit 1f71fae
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/app.router.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 1f71fae

Please sign in to comment.