diff options
| author | Igor Minar | 2011-02-04 09:11:18 -0800 | 
|---|---|---|
| committer | Igor Minar | 2011-02-07 23:56:32 -0800 | 
| commit | bf8013ad57ce30639bb37e7c0b8cf99cab8be650 (patch) | |
| tree | 11207876ea95910936c49c96ffbda89dffa31478 /test | |
| parent | a6c45c3e66fc0ea3baaa908c90720bcf22c193d7 (diff) | |
| download | angular.js-bf8013ad57ce30639bb37e7c0b8cf99cab8be650.tar.bz2 | |
$location.updateHash should not preserve hashSearch when hashSearch is undefined
Diffstat (limited to 'test')
| -rw-r--r-- | test/servicesSpec.js | 8 | 
1 files changed, 8 insertions, 0 deletions
| diff --git a/test/servicesSpec.js b/test/servicesSpec.js index 0876f986..b3f6ec10 100644 --- a/test/servicesSpec.js +++ b/test/servicesSpec.js @@ -314,6 +314,14 @@ describe("service", function(){          expect($location.hashPath).toEqual('path');        }); +      it('should reset hashSearch when updating with a single string', function() { +        $location.updateHash({foo:'bar'}); //set some initial state for hashSearch + +        $location.updateHash('path'); +        expect($location.hashPath).toEqual('path'); +        expect($location.hashSearch).toEqual({}); +      }); +        it('should accept single object argument to update search', function() {          $location.updateHash({a: 'b'});          expect($location.hash).toEqual('?a=b'); | 
