+});
+
+test("jQuery.ajax - transitive conversions", function() {
+
+ expect( 8 );
+
+ stop();
+
+ jQuery.when(
+
+ jQuery.ajax( url("data/json.php") , {
+ converters: {
+ "json myJson": function( data ) {
+ ok( true , "converter called" );
+ return data;
+ }
+ },
+ dataType: "myJson",
+ success: function() {
+ ok( true , "Transitive conversion worked" );
+ strictEqual( this.dataTypes[0] , "text" , "response was retrieved as text" );
+ strictEqual( this.dataTypes[1] , "myjson" , "request expected myjson dataType" );
+ }
+ }),
+
+ jQuery.ajax( url("data/json.php") , {
+ converters: {
+ "json myJson": function( data ) {
+ ok( true , "converter called (*)" );
+ return data;
+ }
+ },
+ contents: false, /* headers are wrong so we ignore them */
+ dataType: "* myJson",
+ success: function() {
+ ok( true , "Transitive conversion worked (*)" );
+ strictEqual( this.dataTypes[0] , "text" , "response was retrieved as text (*)" );
+ strictEqual( this.dataTypes[1] , "myjson" , "request expected myjson dataType (*)" );
+ }
+ })
+
+ ).then( start , start );
+
+});
+
+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 );
+
+ jQuery.ajaxPrefilter(function( options, _, jqXHR ) {
+ if ( options.abortInPrefilter ) {
+ jqXHR.abort();
+ }
+ });
+
+ strictEqual( jQuery.ajax({
+ abortInPrefilter: true,
+ error: function() {
+ ok( false, "error callback called" );
+ }
+ }), false, "Request was properly aborted early by the prefilter" );