File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ var Path = {
8585 var paramName = getParamName ( pathSegment ) ;
8686
8787 invariant (
88- params [ paramName ] ,
88+ params [ paramName ] != null ,
8989 'Missing "' + paramName + '" parameter for path "' + pattern + '"'
9090 ) ;
9191
Original file line number Diff line number Diff line change @@ -127,6 +127,10 @@ describe('Path.injectParams', function () {
127127 it ( 'returns the correct path' , function ( ) {
128128 expect ( Path . injectParams ( pattern , { id : 'abc' } ) ) . toEqual ( 'comments/abc/edit' ) ;
129129 } ) ;
130+
131+ it ( 'returns the correct path when the value is 0' , function ( ) {
132+ expect ( Path . injectParams ( pattern , { id : 0 } ) ) . toEqual ( 'comments/0/edit' ) ;
133+ } ) ;
130134 } ) ;
131135
132136 describe ( 'and some params have special URL encoding' , function ( ) {
You can’t perform that action at this time.
0 commit comments