diff options
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(){ |
