diff options
| author | Vojta Jina | 2010-10-31 02:11:50 +0200 |
|---|---|---|
| committer | Igor Minar | 2010-10-31 21:37:33 -0700 |
| commit | 99f25050a34a0f0e2b0bdc63a55f38097f7098db (patch) | |
| tree | 69551702f0ecefb50ab2d399589ba64b501f0dd4 /test/servicesSpec.js | |
| parent | ba5f8ee27f03b3215835bc1e643eb25b8f2e217f (diff) | |
| download | angular.js-99f25050a34a0f0e2b0bdc63a55f38097f7098db.tar.bz2 | |
Fixing issue #98 (infinite loop when location hash set empty)
Added tests and fixed the issue.
Closes #98
Diffstat (limited to 'test/servicesSpec.js')
| -rw-r--r-- | test/servicesSpec.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/servicesSpec.js b/test/servicesSpec.js index 276f5de9..f4d9aabe 100644 --- a/test/servicesSpec.js +++ b/test/servicesSpec.js @@ -207,6 +207,18 @@ describe("service", function(){ expect(scope.$location.hashSearch).toEqual({a: 'b'}); expect(scope.$location.hashPath).toEqual('path'); }); + + it('should remove # if hash is empty', function() { + scope.$location.update('http://www.angularjs.org/index.php#'); + expect(scope.$location.href).toEqual('http://www.angularjs.org/index.php'); + }); + + it('should not change browser\'s url with empty hash', function() { + $browser.setUrl('http://www.angularjs.org/index.php#'); + spyOn($browser, 'setUrl'); + $browser.poll(); + expect($browser.setUrl).not.toHaveBeenCalled(); + }); }); describe("$invalidWidgets", function(){ |
