aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/routeParamsSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ng/routeParamsSpec.js')
-rw-r--r--test/ng/routeParamsSpec.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ng/routeParamsSpec.js b/test/ng/routeParamsSpec.js
index e3aac1a2..07c6d4f7 100644
--- a/test/ng/routeParamsSpec.js
+++ b/test/ng/routeParamsSpec.js
@@ -17,4 +17,16 @@ describe('$routeParams', function() {
expect($routeParams).toEqual({barId:'123', x:'abc'});
});
});
+
+ it('should correctly extract the params when a param name is part of the route', function() {
+ module(function($routeProvider) {
+ $routeProvider.when('/bar/:foo/:bar', {});
+ });
+
+ inject(function($rootScope, $route, $location, $routeParams) {
+ $location.path('/bar/foovalue/barvalue');
+ $rootScope.$digest();
+ expect($routeParams).toEqual({bar:'barvalue', foo:'foovalue'});
+ });
+ });
});