diff options
author | Oleg <markelog@gmail.com> | 2012-05-01 14:39:45 -0400 |
---|---|---|
committer | Rick Waldron waldron.rick@gmail.com <waldron.rick@gmail.com> | 2012-05-01 14:39:45 -0400 |
commit | 6bed348a007f8467dfc09cf63a1783bce673c3f4 (patch) | |
tree | 299075c77f89a6bc8880c4b58a1145ec1b5d3283 /test | |
parent | dc3c983be094ee5c90d992c89b3a805feb6c4e26 (diff) | |
download | jquery-6bed348a007f8467dfc09cf63a1783bce673c3f4.tar.gz jquery-6bed348a007f8467dfc09cf63a1783bce673c3f4.zip |
jQuery.ajaxSetup() data is merged with params. Fixes #10524
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/ajax.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js index cca72aa5c..ede6d0f66 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -1257,6 +1257,24 @@ test("load(String, String, Function)", function() { }); }); +asyncTest("load() - #10524", 1, function() { + jQuery.ajaxSetup({ + data: { foo: "bar" } + }); + + var data = { + baz: 1 + }; + + jQuery("#foo").load( "data/echoQuery.php", data).ajaxComplete(function( event, jqXHR, options ) { + ok( ~options.data.indexOf("foo=bar"), "Data from ajaxSettings was used" ); + jQuery.ajaxSetup({ + data: null + }); + start(); + }); +}); + test("jQuery.get(String, Function) - data in ajaxSettings (#8277)", function() { expect(1); stop(); @@ -2411,4 +2429,4 @@ test("jQuery.ajax - active counter", function() { ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active ); }); -}
\ No newline at end of file +} |