X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fajax.js;h=5b5f95f06698475581b74f04c8cd05bfbb781683;hb=2a268f5f4b5b1d870d5af580de4c768e0121e5b5;hp=fbff2d82e535a339602ec72e230b97738368f815;hpb=90a87c03b4943d75c24bc5e6246630231d12d933;p=jquery.git diff --git a/test/unit/ajax.js b/test/unit/ajax.js index fbff2d8..5b5f95f 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -874,6 +874,58 @@ test("data option: evaluate function values (#2806)", function() { }) }); +test("jQuery.ajax - If-Modified-Since support", function() { + expect( 3 ); + + stop(); + + var url = "data/if_modified_since.php?ts=" + new Date(); + + jQuery.ajax({ + url: url, + ifModified: true, + success: function(data, status) { + equals(status, "success"); + + jQuery.ajax({ + url: url, + ifModified: true, + success: function(data, status) { + equals(status, "notmodified"); + ok(data == null, "response body should be empty") + start(); + } + }); + } + }); +}); + +test("jQuery.ajax - Etag support", function() { + expect( 3 ); + + stop(); + + var url = "data/etag.php?ts=" + new Date(); + + jQuery.ajax({ + url: url, + ifModified: true, + success: function(data, status) { + equals(status, "success"); + + jQuery.ajax({ + url: url, + ifModified: true, + success: function(data, status) { + equals(status, "notmodified"); + ok(data == null, "response body should be empty") + start(); + } + }); + } + }); +}); + } //}