views:

3

answers:

0

I'm trying to test a utility method I have that creates urlencoded query strings. It somehow decodes "expected" in to: ?foo=foo val&bar=bar&val ... so it's decoding the urlencoding!

test("test make_params properly url encodes", function() {
    var o = {"foo":'foo val',"bar":'bar&val'}; 
    var actual = make_params(o);
    equals('?foo=foo+val&bar=bar%26val', actual, "Expected urlencoded string built to be" + '?foo=foo+val&bar=bar%26val');
});

Results in: 1. Expected urlencoded string built to be?foo=foo+val&bar=bar%26val, expected: "?foo=foo val&bar=bar&val" result: "?foo=foo+val&bar=bar%26val", diff: "?foo=foo val&bar=bar&val" "?foo=foo+val&bar=bar%26val"

Is this a bug in qunit or am I overlooking something?