@@ -194,28 +194,21 @@ describe("UrlRouter", function () {
194194
195195 describe ( "location updates" , function ( ) {
196196 it ( 'can push location changes' , inject ( function ( $urlRouter ) {
197- spyOn ( services . location , "url" ) ;
198- spyOn ( services . location , "replace" ) ;
197+ spyOn ( services . location , "setUrl" ) ;
199198 $urlRouter . push ( makeMatcher ( "/hello/:name" ) , { name : "world" } ) ;
200-
201- expect ( services . location . url ) . toHaveBeenCalledWith ( "/hello/world" ) ;
202- expect ( services . location . replace ) . not . toHaveBeenCalled ( ) ;
199+ expect ( services . location . setUrl ) . toHaveBeenCalledWith ( "/hello/world" , undefined ) ;
203200 } ) ) ;
204201
205202 it ( 'can push a replacement location' , inject ( function ( $urlRouter , $location ) {
206- spyOn ( services . location , "url" ) ;
207- spyOn ( services . location , "replace" ) ;
203+ spyOn ( services . location , "setUrl" ) ;
208204 $urlRouter . push ( makeMatcher ( "/hello/:name" ) , { name : "world" } , { replace : true } ) ;
209-
210- expect ( services . location . url ) . toHaveBeenCalledWith ( "/hello/world" ) ;
211- expect ( services . location . replace ) . toHaveBeenCalled ( ) ;
205+ expect ( services . location . setUrl ) . toHaveBeenCalledWith ( "/hello/world" , true ) ;
212206 } ) ) ;
213207
214208 it ( 'can push location changes with no parameters' , inject ( function ( $urlRouter , $location ) {
215- spyOn ( services . location , "url " ) ;
209+ spyOn ( services . location , "setUrl " ) ;
216210 $urlRouter . push ( makeMatcher ( "/hello/:name" , { params :{ name : "" } } ) ) ;
217-
218- expect ( services . location . url ) . toHaveBeenCalledWith ( "/hello/" ) ;
211+ expect ( services . location . setUrl ) . toHaveBeenCalledWith ( "/hello/" , undefined ) ;
219212 } ) ) ;
220213
221214 it ( 'can push location changes that include a #fragment' , inject ( function ( $urlRouter , $location ) {
@@ -237,9 +230,9 @@ describe("UrlRouter", function () {
237230 it ( 'can read and sync a copy of location URL' , inject ( function ( $urlRouter , $location ) {
238231 $location . url ( '/old' ) ;
239232
240- spyOn ( services . location , 'url ' ) . and . callThrough ( ) ;
233+ spyOn ( services . location , 'path ' ) . and . callThrough ( ) ;
241234 $urlRouter . update ( true ) ;
242- expect ( services . location . url ) . toHaveBeenCalled ( ) ;
235+ expect ( services . location . path ) . toHaveBeenCalled ( ) ;
243236
244237 $location . url ( '/new' ) ;
245238 $urlRouter . update ( ) ;
0 commit comments