datahub/test/util.test.js
Rufus Pollock 733a9d3275 [#34,view][s]: query state in url (store into and read from).
* Also change so that query values are not automatically JSON.stringify-ied (bad idea since it leads to repeated jsonification of same value ...)
2012-03-14 19:45:28 +00:00

23 lines
468 B
JavaScript

(function ($) {
module("Util");
test('parseHashUrl', function () {
var out = recline.View.parseHashUrl('graph?x=y');
equal(out.path, 'graph');
equal(out.query, '?x=y');
var out = recline.View.parseHashUrl('graph');
equal(out.path, 'graph');
equal(out.query, '');
});
test('composeQueryString', function () {
var params = {
x: 'y',
a: 'b'
};
var out = recline.View.composeQueryString(params);
equal(out, '?x=y&a=b');
});
})(this.jQuery);