mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
Add missing tests for toKeyValue() function
This commit is contained in:
parent
ce49c361d7
commit
732bcd8a36
1 changed files with 11 additions and 0 deletions
|
|
@ -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=');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue