diff options
| author | Vojta Jina | 2010-10-16 16:13:53 +0100 |
|---|---|---|
| committer | Igor Minar | 2010-10-16 22:10:01 -0700 |
| commit | 732bcd8a368d50995c796373e37be5a4d3b2bc8c (patch) | |
| tree | e47e8b20493d5735c07f08a367cb78fd82910f36 /test/AngularSpec.js | |
| parent | ce49c361d71d1c5f8dc5b773298945957dba0175 (diff) | |
| download | angular.js-732bcd8a368d50995c796373e37be5a4d3b2bc8c.tar.bz2 | |
Add missing tests for toKeyValue() function
Diffstat (limited to 'test/AngularSpec.js')
| -rw-r--r-- | test/AngularSpec.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/AngularSpec.js b/test/AngularSpec.js index 6faed707..64fd8997 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -104,3 +104,14 @@ describe('parseKeyValue', function() { toEqual({flag1: true, key: 'value', flag2: true}); }); }); + +describe('toKeyValue', function() { + it('should parse key-value pairs into string', function() { + expect(toKeyValue({})).toEqual(''); + expect(toKeyValue({simple: 'pair'})).toEqual('simple=pair'); + expect(toKeyValue({first: '1', second: '2'})).toEqual('first=1&second=2'); + expect(toKeyValue({'escaped key': 'escaped value'})). + toEqual('escaped%20key=escaped%20value'); + expect(toKeyValue({emptyKey: ''})).toEqual('emptyKey='); + }); +}); |
