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 = {
85
85
var paramName = getParamName ( pathSegment ) ;
86
86
87
87
invariant (
88
- params [ paramName ] ,
88
+ params [ paramName ] != null ,
89
89
'Missing "' + paramName + '" parameter for path "' + pattern + '"'
90
90
) ;
91
91
Original file line number Diff line number Diff line change @@ -127,6 +127,10 @@ describe('Path.injectParams', function () {
127
127
it ( 'returns the correct path' , function ( ) {
128
128
expect ( Path . injectParams ( pattern , { id : 'abc' } ) ) . toEqual ( 'comments/abc/edit' ) ;
129
129
} ) ;
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
+ } ) ;
130
134
} ) ;
131
135
132
136
describe ( 'and some params have special URL encoding' , function ( ) {
You can’t perform that action at this time.
0 commit comments