X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fajax.js;h=8e3c4b67072d08f28a4a1d1a426542c721d20d61;hb=90a4abd5111e57213059eb80876551ae1fac6c53;hp=135e0541a8ca726039ae3a12ca9e81e1978d5001;hpb=0fbac16dbe77b6bf846b43d3ef3bd75c374e2628;p=jquery.git diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 135e054..8e3c4b6 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -836,7 +836,7 @@ test("jQuery.ajax() - JSONP, Remote", function() { test("jQuery.ajax() - script, Remote", function() { expect(2); - var base = window.location.href.replace(/\?.*$/, ""); + var base = window.location.href.replace(/[^\/]*$/, ""); stop(); @@ -853,7 +853,7 @@ test("jQuery.ajax() - script, Remote", function() { test("jQuery.ajax() - script, Remote with POST", function() { expect(3); - var base = window.location.href.replace(/\?.*$/, ""); + var base = window.location.href.replace(/[^\/]*$/, ""); stop(); @@ -876,7 +876,7 @@ test("jQuery.ajax() - script, Remote with POST", function() { test("jQuery.ajax() - script, Remote with scheme-less URL", function() { expect(2); - var base = window.location.href.replace(/\?.*$/, ""); + var base = window.location.href.replace(/[^\/]*$/, ""); base = base.replace(/^.*?\/\//, "//"); stop(); @@ -991,7 +991,7 @@ test("jQuery.getJSON - Using Native JSON", function() { test("jQuery.getJSON(String, Function) - JSON object with absolute url to local content", function() { expect(2); - var base = window.location.href.replace(/\?.*$/, ""); + var base = window.location.href.replace(/[^\/]*$/, ""); stop(); jQuery.getJSON(url(base + "data/json.php"), function(json) { @@ -1163,6 +1163,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 ); @@ -1225,6 +1238,12 @@ test("jQuery.ajax - Etag support", function() { }); }); + +test("jQuery.ajax - active counter", function() { + ok( jQuery.ajax.active == 0, "ajax active counter should be zero: " + jQuery.ajax.active ); +}); + + } //}