X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fajax.js;h=b7eb57d8e841ea458beb41069cff70fe2863e51f;hb=7367b524ec6c7cda0a4146e50a5dc6d7764bdef7;hp=fe44ba3b619ca88f92efbca238d7f441e8f4e440;hpb=d1931a8241dcac1617cc8388f6dd6284c89c545d;p=jquery.git diff --git a/test/unit/ajax.js b/test/unit/ajax.js index fe44ba3..b7eb57d 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -68,6 +68,47 @@ test("jQuery.ajax() - error callbacks", function() { }); }); +test(".ajax() - hash", function() { + expect(3); + + jQuery.ajax({ + url: "data/name.html#foo", + beforeSend: function( xhr, settings ) { + equals(settings.url, "data/name.html", "Make sure that the URL is trimmed."); + return false; + } + }); + + jQuery.ajax({ + url: "data/name.html?abc#foo", + beforeSend: function( xhr, settings ) { + equals(settings.url, "data/name.html?abc", "Make sure that the URL is trimmed."); + return false; + } + }); + + jQuery.ajax({ + url: "data/name.html?abc#foo", + data: { "test": 123 }, + beforeSend: function( xhr, settings ) { + equals(settings.url, "data/name.html?abc&test=123", "Make sure that the URL is trimmed."); + return false; + } + }); +}); + +test(".ajax() - 304", function() { + expect( 1 ); + stop(); + + jQuery.ajax({ + url: url("data/notmodified.php"), + success: function(){ ok(true, "304 ok"); }, + error: function(){ ok(false, "304 not ok "); }, + complete: function(xhr){ start(); } + }); +}); + test(".load()) - 404 error callbacks", function() { expect( 6 ); stop(); @@ -1163,6 +1204,19 @@ test("data option: evaluate function values (#2806)", function() { }) }); +test("data option: empty bodies for non-GET requests", function() { + stop(); + jQuery.ajax({ + url: "data/echoData.php", + data: undefined, + type: "post", + success: function(result) { + equals( result, "" ); + start(); + } + }) +}); + test("jQuery.ajax - If-Modified-Since support", function() { expect( 3 );