From 22cb600280cecabf719ba1878719c907aa01ba18 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Tue, 12 Jul 2011 02:18:17 +0200 Subject: fix($route): update $route to reflect $location changes * update $route to reflect new $location * add some more unit tests to $route * fix some other failing unit tests * redirect overrides the url now Breaks $route custom redirect fn has only 3 params now --- test/service/routeParamsSpec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/service/routeParamsSpec.js') diff --git a/test/service/routeParamsSpec.js b/test/service/routeParamsSpec.js index 58a37f2e..8cdf3af3 100644 --- a/test/service/routeParamsSpec.js +++ b/test/service/routeParamsSpec.js @@ -10,11 +10,11 @@ describe('$routeParams', function(){ $route.when('/foo'); $route.when('/bar/:barId'); - $location.hash = '/foo?a=b'; + $location.path('/foo').search('a=b'); scope.$digest(); expect($routeParams).toEqual({a:'b'}); - $location.hash = '/bar/123?x=abc'; + $location.path('/bar/123').search('x=abc'); scope.$digest(); expect($routeParams).toEqual({barId:'123', x:'abc'}); }); @@ -30,11 +30,11 @@ describe('$routeParams', function(){ $route.when('/foo'); $route.when('/bar/:barId'); - $location.hash = '/foo?a=b'; + $location.path('/foo').search('a=b'); scope.$digest(); expect(scope.$service('$routeParams')).toBe(firstRouteParams); - $location.hash = '/bar/123?x=abc'; + $location.path('/bar/123').search('x=abc'); scope.$digest(); expect(scope.$service('$routeParams')).toBe(firstRouteParams); }); -- cgit v1.2.3