Skip to content
Myr

Fixed mock request params

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 062deb6 · Browse files · 2 files+29 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

2 files+29 added−0 removed

  • tests:+29 added−0 removed

2 files+29 added−0 removed

modified:lib/express.spec.helpers.js+1 added
modified:spec/spec.routing.js+28 added
83 unmodified lines
84 Express.regexpKeys.should.eql ['page']85 end86 end87 88 describe 'routing functions'89 before_each90 Express.routes = []91 end92 93 it 'should set last expression as response body'94 get('user', function(){ 'tj' })95 get('user').body.should.eql 'tj'96 end97 98 it 'should disregard leading and trailing slashes'99 get('/one', function(){ 'tj' })100 get('one').body.should.eql 'tj'101 102 get('/two/', function(){ 'tj' })103 get('two').body.should.eql 'tj'104 105 get('three/', function(){ 'tj' })106 get('three').body.should.eql 'tj'107 end108 109 it 'should populate params hash when using param keys'110 get('/user/:name', function(){ param('name') })111 get('/user/tj').body.should.eql 'tj'112 get('/user/joe').body.should.eql 'joe'113 end114 end115 116 end117end