@@ -67,12 +67,14 @@ describe('Path.extractParams', function () {
67
67
expect ( Path . extractParams ( pattern , 'comments/123/edit' ) ) . toEqual ( { id : '123' } ) ;
68
68
} ) ;
69
69
} ) ;
70
+
70
71
describe ( 'and the path matches without supplied param' , function ( ) {
71
- it ( 'returns an object with param set to null ' , function ( ) {
72
- expect ( Path . extractParams ( pattern , 'comments//edit' ) ) . toEqual ( { id : null } ) ;
72
+ it ( 'returns an object with an undefined param ' , function ( ) {
73
+ expect ( Path . extractParams ( pattern , 'comments//edit' ) ) . toEqual ( { id : undefined } ) ;
73
74
} ) ;
74
75
} ) ;
75
76
} ) ;
77
+
76
78
describe ( 'and the pattern and forward slash are optional' , function ( ) {
77
79
var pattern = 'comments/:id?/?edit'
78
80
@@ -81,12 +83,14 @@ describe('Path.extractParams', function () {
81
83
expect ( Path . extractParams ( pattern , 'comments/123/edit' ) ) . toEqual ( { id : '123' } ) ;
82
84
} ) ;
83
85
} ) ;
86
+
84
87
describe ( 'and the path matches without supplied param' , function ( ) {
85
- it ( 'returns an object with param set to null ' , function ( ) {
86
- expect ( Path . extractParams ( pattern , 'comments/edit' ) ) . toEqual ( { id : null } ) ;
88
+ it ( 'returns an object with an undefined param ' , function ( ) {
89
+ expect ( Path . extractParams ( pattern , 'comments/edit' ) ) . toEqual ( { id : undefined } ) ;
87
90
} ) ;
88
91
} ) ;
89
92
} ) ;
93
+
90
94
describe ( 'and the path does not match' , function ( ) {
91
95
it ( 'returns null' , function ( ) {
92
96
expect ( Path . extractParams ( pattern , 'users/123' ) ) . toBe ( null ) ;
0 commit comments