diff options
Diffstat (limited to 'test/service/routeParamsSpec.js')
| -rw-r--r-- | test/service/routeParamsSpec.js | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/test/service/routeParamsSpec.js b/test/service/routeParamsSpec.js index d4088767..d1b2ecb1 100644 --- a/test/service/routeParamsSpec.js +++ b/test/service/routeParamsSpec.js @@ -1,16 +1,20 @@ 'use strict'; describe('$routeParams', function() { - it('should publish the params into a service', inject(function($rootScope, $route, $location, $routeParams) { - $route.when('/foo'); - $route.when('/bar/:barId'); + it('should publish the params into a service', function() { + module(function($routeProvider) { + $routeProvider.when('/foo'); + $routeProvider.when('/bar/:barId'); + }); - $location.path('/foo').search('a=b'); - $rootScope.$digest(); - expect($routeParams).toEqual({a:'b'}); + inject(function($rootScope, $route, $location, $routeParams) { + $location.path('/foo').search('a=b'); + $rootScope.$digest(); + expect($routeParams).toEqual({a:'b'}); - $location.path('/bar/123').search('x=abc'); - $rootScope.$digest(); - expect($routeParams).toEqual({barId:'123', x:'abc'}); - })); + $location.path('/bar/123').search('x=abc'); + $rootScope.$digest(); + expect($routeParams).toEqual({barId:'123', x:'abc'}); + }); + }); }); |
