aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-02-05 19:43:31 -0500
committerjeresig <jeresig@gmail.com>2010-02-05 19:43:31 -0500
commit54bd004e53b4d89e9e7e7533f11c23ff99f70d73 (patch)
treec64ffaec3c1b5a7a056ba1dd70d7a4a5e2c7d8a7 /test
parent43b3ed086dd850388c72ea1cabb557125dfe095a (diff)
downloadjquery-54bd004e53b4d89e9e7e7533f11c23ff99f70d73.tar.gz
jquery-54bd004e53b4d89e9e7e7533f11c23ff99f70d73.zip
Make sure that we don't try to double-encode params using the traditional style. Fixes #6041.
Diffstat (limited to 'test')
-rw-r--r--test/unit/ajax.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index f6809d539..4a823ac1b 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -351,9 +351,9 @@ test("serialize()", function() {
});
test("jQuery.param()", function() {
- expect(18);
+ expect(19);
- equals( !jQuery.ajaxSettings.traditional, true, "traditional flag, falsy by default" );
+ equals( !jQuery.ajaxSettings.traditional, true, "traditional flag, falsy by default" );
var params = {foo:"bar", baz:42, quux:"All your base are belong to us"};
equals( jQuery.param(params), "foo=bar&baz=42&quux=All+your+base+are+belong+to+us", "simple" );
@@ -378,6 +378,8 @@ test("jQuery.param()", function() {
params = { a:[1,2], b:{ c:3, d:[4,5], e:{ x:[6], y:7, z:[8,9] }, f:true, g:false, h:undefined }, i:[10,11], j:true, k:false, l:[undefined,0], m:"cowboy hat?" };
equals( jQuery.param(params,true), "a=1&a=2&b=%5Bobject+Object%5D&i=10&i=11&j=true&k=false&l=undefined&l=0&m=cowboy+hat%3F", "huge structure, forced traditional" );
+
+ equals( decodeURIComponent( jQuery.param({ "test[]": [0, 1, 2] }) ), "test[]=0&test[]=1&test[]=2", "Make sure params are double-encoded." );
jQuery.ajaxSetup({ traditional: true });