diff options
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r-- | test/unit/ajax.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 9527beea1..8e50153ee 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -1031,6 +1031,19 @@ test("jQuery.param()", function() { equal( jQuery.param( params, false ), "test%5Blength%5D=3&test%5Bfoo%5D=bar", "Sub-object with a length property" ); }); +test("jQuery.param() Constructed prop values", function() { + expect(3); + + var params = {"test": new String("foo") }; + equal( jQuery.param( params, false ), "test=foo", "Do not mistake new String() for a plain object" ); + + params = {"test": new Number(5) }; + equal( jQuery.param( params, false ), "test=5", "Do not mistake new Number() for a plain object" ); + + params = {"test": new Date() }; + ok( jQuery.param( params, false ), "(Non empty string returned) Do not mistake new Date() for a plain object" ); +}); + test("synchronous request", function() { expect(1); ok( /^{ "data"/.test( jQuery.ajax({url: url("data/json_obj.js"), dataType: "text", async: false}).responseText ), "check returned text" ); |