@@ -126,6 +126,24 @@ describe('Path.extractParams', function () {
126126 } ) ;
127127 } ) ;
128128 } ) ;
129+
130+ describe ( 'when a param has dots' , function ( ) {
131+ var pattern = '/:query/with/:domain' ;
132+
133+ describe ( 'and the path matches' , function ( ) {
134+ it ( 'returns an object with the params' , function ( ) {
135+ expect ( Path . extractParams ( pattern , '/foo/with/foo.app' ) ) . toEqual ( { query : 'foo' , domain : 'foo.app' } ) ;
136+ expect ( Path . extractParams ( pattern , '/foo.ap/with/foo' ) ) . toEqual ( { query : 'foo.ap' , domain : 'foo' } ) ;
137+ expect ( Path . extractParams ( pattern , '/foo.ap/with/foo.app' ) ) . toEqual ( { query : 'foo.ap' , domain : 'foo.app' } ) ;
138+ } ) ;
139+ } ) ;
140+
141+ describe ( 'and the path does not match' , function ( ) {
142+ it ( 'returns null' , function ( ) {
143+ expect ( Path . extractParams ( pattern , '/foo.ap' ) ) . toBe ( null ) ;
144+ } ) ;
145+ } ) ;
146+ } ) ;
129147} ) ;
130148
131149describe ( 'Path.injectParams' , function ( ) {
@@ -169,6 +187,12 @@ describe('Path.injectParams', function () {
169187 expect ( Path . injectParams ( pattern , { id : 'the/id' } ) ) . toEqual ( 'comments/the/id/edit' ) ;
170188 } ) ;
171189 } ) ;
190+
191+ describe ( 'and some params contain dots' , function ( ) {
192+ it ( 'returns the correct path' , function ( ) {
193+ expect ( Path . injectParams ( pattern , { id : 'alt.black.helicopter' } ) ) . toEqual ( 'comments/alt.black.helicopter/edit' ) ;
194+ } ) ;
195+ } ) ;
172196 } ) ;
173197
174198 describe ( 'when a pattern has multiple splats' , function ( ) {
0 commit comments