Files
meteor/packages/url/url_tests.js
Hugh Willson e6d905ca54 Adjusted query string array representation to remove indices. (#8342)
* Adjusted query string array representation to remove indices.

* Increased major version since the new _encodeParams() result is not backwards compatiable.
2017-02-10 17:34:27 +02:00

15 lines
420 B
JavaScript

Tinytest.add('url - serializes params to query correctly', function (test) {
var hash = {
filter: {
type: 'Foo',
id_eq: 15,
},
array: ['1', 'a', 'dirty[]'],
hasOwnProperty: 'horrible param name',
};
var query =
'filter[type]=Foo&filter[id_eq]=15&array[]=1&array[]=a'
+ '&array[]=dirty%5B%5D&hasOwnProperty=horrible+param+name';
test.equal(URL._encodeParams(hash), query);
});