diff options
| author | Mykhailo Kotsur | 2012-03-29 22:16:10 +0200 | 
|---|---|---|
| committer | Igor Minar | 2012-04-02 08:35:30 -0700 | 
| commit | 59fa40ec0e851759d35fb0ea5fd01019d1403049 (patch) | |
| tree | de57cb46d1f1f574cab8cdc1f2ac097a35980f2e /test/ng/locationSpec.js | |
| parent | a1f7f5d4d06cc3cea97cf0ab134f14966b9b010a (diff) | |
| download | angular.js-59fa40ec0e851759d35fb0ea5fd01019d1403049.tar.bz2 | |
fix($location): search setter should not double-encode the value
By mistake both the setter and helper function that composes the whole
url were encoding the search values.
Closes #751
Diffstat (limited to 'test/ng/locationSpec.js')
| -rw-r--r-- | test/ng/locationSpec.js | 13 | 
1 files changed, 13 insertions, 0 deletions
| diff --git a/test/ng/locationSpec.js b/test/ng/locationSpec.js index 646a9ca0..164251ab 100644 --- a/test/ng/locationSpec.js +++ b/test/ng/locationSpec.js @@ -330,6 +330,19 @@ describe('$location', function() {          expect(url.search()).toEqual({'i j': '<>#'});          expect(url.hash()).toBe('x <>#');        }); + + +      it('should return decoded characters for search specified in URL', function() { +        var locationUrl = new LocationUrl('http://host.com/?q=1%2F2%203'); +        expect(locationUrl.search()).toEqual({'q': '1/2 3'}); +      }); + + +      it('should return decoded characters for search specified with setter', function() { +        var locationUrl = new LocationUrl('http://host.com/'); +        locationUrl.search('q', '1/2 3'); +        expect(locationUrl.search()).toEqual({'q': '1/2 3'}); +      });      });    }); | 
