X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fajax.js;h=335c2ac4d310348eda37d17a602b9a4d63940c2a;hb=5b38439011799ae53156d137305d9440e0cddb0a;hp=c9c06111fd01feb2480fc73b4745da83e6454692;hpb=481d940e79f9d01e49218bf76575849158214e28;p=jquery.git diff --git a/test/unit/ajax.js b/test/unit/ajax.js index c9c0611..335c2ac 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -344,7 +344,7 @@ test(".ajax() - retry with jQuery.ajax( this )", function() { test(".ajax() - headers" , function() { - expect( 2 ); + expect( 4 ); stop(); @@ -376,8 +376,14 @@ test(".ajax() - headers" , function() { tmp.push( "ajax-send: test\n" ); tmp = tmp.join( "" ); - equals( data , tmp , "Headers were sent" ); - equals( xhr.getResponseHeader( "Sample-Header" ) , "Hello World" , "Sample header received" ); + strictEqual( data , tmp , "Headers were sent" ); + strictEqual( xhr.getResponseHeader( "Sample-Header" ) , "Hello World" , "Sample header received" ); + if ( jQuery.browser.mozilla ) { + ok( true, "Firefox doesn't support empty headers" ); + } else { + strictEqual( xhr.getResponseHeader( "Empty-Header" ) , "" , "Empty header received" ); + } + strictEqual( xhr.getResponseHeader( "Sample-Header2" ) , "Hello World 2" , "Second sample header received" ); }, error: function(){ ok(false, "error"); } @@ -1196,6 +1202,21 @@ test("load(String, String, Function)", function() { }); }); +test("jQuery.get(String, Function) - data in ajaxSettings (#8277)", function() { + expect(1); + stop(); + jQuery.ajaxSetup({ + data: "helloworld" + }); + jQuery.get(url('data/echoQuery.php'), function(data) { + ok( /helloworld$/.test( data ), 'Data from ajaxSettings was used'); + jQuery.ajaxSetup({ + data: null + }); + start(); + }); +}); + test("jQuery.get(String, Hash, Function) - parse xml and use text() on nodes", function() { expect(2); stop();