Skip to content

Commit fde8f64

Browse files
hiowenlukedougwilson
authored andcommitted
examples: fix route in params example
closes #3310
1 parent 6da454c commit fde8f64

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/params/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ app.get('/users/:from-:to', function(req, res, next){
6868
var from = req.params.from;
6969
var to = req.params.to;
7070
var names = users.map(function(user){ return user.name; });
71-
res.send('users ' + names.slice(from, to).join(', '));
71+
res.send('users ' + names.slice(from, to + 1).join(', '));
7272
});
7373

7474
/* istanbul ignore next */

test/acceptance/params.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ describe('params', function(){
2929
describe('GET /users/0-2', function(){
3030
it('should respond with three users', function(done){
3131
request(app)
32-
.get('/users/0-2')
33-
.expect(/users tj, tobi/,done)
32+
.get('/users/0-2')
33+
.expect(/users tj, tobi, loki/, done)
3434
})
3535
})
3636

0 commit comments

Comments
 (0)