X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fajax.js;h=74c6545c5cb9ce6f7d4fb3e5b44a8f192c55d432;hb=f6e173437e9f94cd4e713e556c6fc8ca68be8384;hp=59159c320734cfcdfebfd374c5ae831166e0ab67;hpb=806d9ce8111128c4f30c6559c325f8a4ad1018a3;p=jquery.git diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 59159c3..74c6545 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -2169,6 +2169,34 @@ test("jQuery.ajax - transitive conversions", function() { }); +test("jQuery.ajax - overrideMimeType", function() { + + expect( 2 ); + + stop(); + + jQuery.when( + + jQuery.ajax( url("data/json.php") , { + beforeSend: function( xhr ) { + xhr.overrideMimeType( "application/json" ); + }, + success: function( json ) { + ok( json.data , "Mimetype overriden using beforeSend" ); + } + }), + + jQuery.ajax( url("data/json.php") , { + mimeType: "application/json", + success: function( json ) { + ok( json.data , "Mimetype overriden using mimeType option" ); + } + }) + + ).then( start , start ); + +}); + test("jQuery.ajax - abort in prefilter", function() { expect( 1 );