aboutsummaryrefslogtreecommitdiffstats
path: root/test/service/routeParamsSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2012-02-15 15:45:07 -0800
committerVojta Jina2012-02-28 17:46:58 -0800
commitf16bd2f747ed94547eabdc4c337775a22a365255 (patch)
treebffa267eec9e90a8f1bc12c0063402c4c021d685 /test/service/routeParamsSpec.js
parentef7346ff70c745178d5c615e6ae5e559a4549f32 (diff)
downloadangular.js-f16bd2f747ed94547eabdc4c337775a22a365255.tar.bz2
refactor($route): move when/otherwise to provider
Diffstat (limited to 'test/service/routeParamsSpec.js')
-rw-r--r--test/service/routeParamsSpec.js24
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'});
+ });
+ });
});