Skip to content
Myr

wild-card not placeholder

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

authored by visionmedia · committed by visionmedia · parent b75e1ee · Browse files · 1 file+4 added−4 removed
This commit

State

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

Diff stats

1 file+4 added−4 removed

  • tests:+4 added−4 removed

1 file+4 added−4 removed

modified:spec/spec.routing.js+4 added-4 removed
91 unmodified lines
92 -{ get('/user') }.should.throw_error(/InvalidResponseBody: get "\/user" did not respond with a body string/)93 end94 end95 96 describe 'with a placeholder'96 describe 'with a wild-card'97 it 'should still match'98 get('/user/:id', function(){ return 'yay' })99 get('/user/12').body.should.eql 'yay'100 end
10 unmodified lines
111 get('/user/12').body.should.eql '12'112 end113 end114 115 describe 'with several placeholders'115 describe 'with several wild-cards'116 it 'should still match'117 get('/user/:id/:op', function(){ return 'yay' })118 get('/user/12/edit').body.should.eql 'yay'119 end
5 unmodified lines
125 get('/user/12/edit').body.should.eql 'editing user 12'126 end127 end128 129 describe 'with an optional placeholder'129 describe 'with an optional wild-card'130 it 'should match with a value'131 get('/user/:id?', function(){ return 'yay' })132 get('/user/1').body.should.eql 'yay'133 end
16 unmodified lines
150 get('/user/12/edit').body.should.eql 'Not Found'151 end152 end153 154 describe 'with partial placeholder'154 describe 'with partial wild-card'155 it 'should still match'156 get('/report.:format', function(){157 return 'yay'158 })
79 unmodified lines