aboutsummaryrefslogtreecommitdiffstats
path: root/test/AngularSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/AngularSpec.js')
-rw-r--r--test/AngularSpec.js11
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=');
+ });
+});