X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fajax.js;h=195fa27ca4bed06cac80cf1474a8881af0260381;hb=1a14a38ff77839b2a71fbc3f3c0890ebe62438c7;hp=775523e58220bd8801aef9885c5ec1472eb6034c;hpb=f91b944cabf7be9aadb40ffe35fce76b50f5f25f;p=jquery.git diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 775523e..195fa27 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -180,6 +180,27 @@ test("Ajax events with context", function() { }); }); +test("jQuery.ajax context modification", function() { + expect(1); + + stop(); + + var obj = {} + + jQuery.ajax({ + url: url("data/name.html"), + context: obj, + beforeSend: function(){ + this.test = "foo"; + }, + complete: function() { + start(); + } + }); + + equals( obj.test, "foo", "Make sure the original object is maintained." ); +}); + test("jQuery.ajax() - disabled globals", function() { expect( 3 ); stop();