Skip to content
Permalink
Browse files

Fixed the ajax test regarding the jsonp option set to false and added…

… a test to control the prefilter actually does not tamper with the url.
  • Loading branch information
jaubourg committed Jan 16, 2011
1 parent 0e93b2e commit cfca6d3836476a233cf349abc5f433f1ba7b8feb
Showing with 5 additions and 5 deletions.
  1. +5 −5 test/unit/ajax.js
@@ -1117,10 +1117,10 @@ test("jQuery.getScript(String, Function) - no callback", function() {
jQuery.each( [ "Same Domain", "Cross Domain" ] , function( crossDomain , label ) {

test("jQuery.ajax() - JSONP, " + label, function() {
expect(16);
expect(17);

var count = 0;
function plus(){ if ( ++count == 16 ) start(); }
function plus(){ if ( ++count == 17 ) start(); }

stop();

@@ -1343,15 +1343,15 @@ jQuery.each( [ "Same Domain", "Cross Domain" ] , function( crossDomain , label )
jsonpCallback: "XXX",
crossDomain: crossDomain,
beforeSend: function() {
console.log( this.url );
ok( /^data\/jsonp.php\?callback=XXX&_=\d+$/.test( this.url ) ,
"The URL wasn't messed with (GET, custom callback name with no url manipulation)" );
plus();
},
success: function(data){
console.log(data);
ok( data.data, "JSON results returned (GET, custom callback name with no url manipulation)" );
plus();
},
error: function(data){
console.log(data);
ok( false, "Ajax error JSON (GET, custom callback name with no url manipulation)" );
plus();
}

0 comments on commit cfca6d3

Please sign in to comment.
You can’t perform that action at this time.