aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDaniel Nill <daniellnill@gmail.com>2015-08-06 19:49:14 -0700
committerMichał Gołębiowski <m.goleb@gmail.com>2015-09-07 23:00:47 +0200
commitf0b86ec050305ac1fbddd4943361b423d86feb4b (patch)
tree37802283d34b858209c16927b3f11d942ff02735 /test
parent2da0cca7d364cc8211b10b7fe1868754aba4fca6 (diff)
downloadjquery-f0b86ec050305ac1fbddd4943361b423d86feb4b.tar.gz
jquery-f0b86ec050305ac1fbddd4943361b423d86feb4b.zip
Serialize: Handle arrays with null values
(cherry-picked from 3d7ce0a65f0707ff01a851822e57ba80adcff075) Closes gh-2436
Diffstat (limited to 'test')
-rw-r--r--test/unit/serialize.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/unit/serialize.js b/test/unit/serialize.js
index 047861530..a64593603 100644
--- a/test/unit/serialize.js
+++ b/test/unit/serialize.js
@@ -1,7 +1,7 @@
QUnit.module( "serialize", { teardown: moduleTeardown } );
QUnit.test( "jQuery.param()", function( assert ) {
- assert.expect( 22 );
+ assert.expect( 23 );
var params, settings;
@@ -77,6 +77,9 @@ QUnit.test( "jQuery.param()", function( assert ) {
params = { "test": { "length": 3, "foo": "bar" } };
assert.equal( jQuery.param( params, false ), "test%5Blength%5D=3&test%5Bfoo%5D=bar", "Sub-object with a length property" );
+ params = { "test": [ 1, 2, null ] };
+ assert.equal( jQuery.param( params, false ), "test%5B%5D=1&test%5B%5D=2&test%5B%5D=", "object with array property with null value" );
+
if ( jQuery.ajaxSettings === settings ) {
delete jQuery.ajaxSettings;
} else {