diff options
| author | Igor Minar | 2011-09-21 13:47:17 +0200 |
|---|---|---|
| committer | Igor Minar | 2011-09-21 13:47:17 +0200 |
| commit | 2bc39bb0b4f81b77597bb52f8572d231cf4f83e2 (patch) | |
| tree | 69e493793b2d6af6712429a2a55232d1db746e3e /test/service | |
| parent | 62ae7fccbc524ff498779564294ed6e1a7a3f51c (diff) | |
| download | angular.js-2bc39bb0b4f81b77597bb52f8572d231cf4f83e2.tar.bz2 | |
fix($route): fix regex escaping in route matcher
Diffstat (limited to 'test/service')
| -rw-r--r-- | test/service/routeSpec.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/service/routeSpec.js b/test/service/routeSpec.js index 404ff6d5..c8c8cbeb 100644 --- a/test/service/routeSpec.js +++ b/test/service/routeSpec.js @@ -59,6 +59,27 @@ describe('$route', function() { }); + it('should match a route that contains special chars in the path', function() { + $route.when('/$test.23/foo(bar)/:baz', {template: 'test.html'}); + + $location.path('/test'); + scope.$digest(); + expect($route.current).toBeUndefined(); + + $location.path('/$testX23/foo(bar)/222'); + scope.$digest(); + expect($route.current).toBeUndefined(); + + $location.path('/$test.23/foo(bar)/222'); + scope.$digest(); + expect($route.current).toBeDefined(); + + $location.path('/$test.23/foo\\(bar)/222'); + scope.$digest(); + expect($route.current).toBeUndefined(); + }); + + it('should change route even when only search param changes', function() { var callback = jasmine.createSpy('onRouteChange'); |
