@@ -194,28 +194,21 @@ describe("UrlRouter", function () {
194
194
195
195
describe ( "location updates" , function ( ) {
196
196
it ( 'can push location changes' , inject ( function ( $urlRouter ) {
197
- spyOn ( services . location , "url" ) ;
198
- spyOn ( services . location , "replace" ) ;
197
+ spyOn ( services . location , "setUrl" ) ;
199
198
$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 ) ;
203
200
} ) ) ;
204
201
205
202
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" ) ;
208
204
$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 ) ;
212
206
} ) ) ;
213
207
214
208
it ( 'can push location changes with no parameters' , inject ( function ( $urlRouter , $location ) {
215
- spyOn ( services . location , "url " ) ;
209
+ spyOn ( services . location , "setUrl " ) ;
216
210
$urlRouter . push ( makeMatcher ( "/hello/:name" , { params :{ name : "" } } ) ) ;
217
-
218
- expect ( services . location . url ) . toHaveBeenCalledWith ( "/hello/" ) ;
211
+ expect ( services . location . setUrl ) . toHaveBeenCalledWith ( "/hello/" , undefined ) ;
219
212
} ) ) ;
220
213
221
214
it ( 'can push location changes that include a #fragment' , inject ( function ( $urlRouter , $location ) {
@@ -237,9 +230,9 @@ describe("UrlRouter", function () {
237
230
it ( 'can read and sync a copy of location URL' , inject ( function ( $urlRouter , $location ) {
238
231
$location . url ( '/old' ) ;
239
232
240
- spyOn ( services . location , 'url ' ) . and . callThrough ( ) ;
233
+ spyOn ( services . location , 'path ' ) . and . callThrough ( ) ;
241
234
$urlRouter . update ( true ) ;
242
- expect ( services . location . url ) . toHaveBeenCalled ( ) ;
235
+ expect ( services . location . path ) . toHaveBeenCalled ( ) ;
243
236
244
237
$location . url ( '/new' ) ;
245
238
$urlRouter . update ( ) ;
0 commit comments