mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Unit test for #12004
This commit is contained in:
parent
081c4efcf7
commit
6378a19c46
@ -1521,6 +1521,40 @@ module( "ajax", {
|
||||
}, "exception bubbled" );
|
||||
});
|
||||
|
||||
jQuery.each( [ "method", "type" ], function( _, globalOption ) {
|
||||
|
||||
function request( option ) {
|
||||
var options = {
|
||||
url: url("data/echoData.php"),
|
||||
data: "hello",
|
||||
success: function( msg ) {
|
||||
strictEqual( msg, "hello", "Check for POST (no override)" );
|
||||
}
|
||||
};
|
||||
if ( option ) {
|
||||
options[ option ] = "GET";
|
||||
options.success = function( msg ) {
|
||||
strictEqual( msg, "", "Check for no POST (overriding with " + option + ")" );
|
||||
};
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
ajaxTest( "#12004 - jQuery.ajax() - method is an alias of type - " + globalOption + " set globally", 3, {
|
||||
setup: function() {
|
||||
var options = {};
|
||||
options[ globalOption ] = "POST";
|
||||
jQuery.ajaxSetup( options );
|
||||
},
|
||||
requests: [
|
||||
request("type"),
|
||||
request("method"),
|
||||
request()
|
||||
]
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
//----------- jQuery.ajaxPrefilter()
|
||||
|
||||
ajaxTest( "jQuery.ajaxPrefilter() - abort", 1, {
|
||||
|
Loading…
Reference in New Issue
Block a user