aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVojta Jina2010-10-31 02:11:50 +0200
committerIgor Minar2010-10-31 21:37:33 -0700
commit99f25050a34a0f0e2b0bdc63a55f38097f7098db (patch)
tree69551702f0ecefb50ab2d399589ba64b501f0dd4 /test
parentba5f8ee27f03b3215835bc1e643eb25b8f2e217f (diff)
downloadangular.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')
-rw-r--r--test/servicesSpec.js12
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(){