diff options
author | John Resig <jeresig@gmail.com> | 2010-01-25 01:08:24 -0500 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2010-01-25 01:08:24 -0500 |
commit | 1a14a38ff77839b2a71fbc3f3c0890ebe62438c7 (patch) | |
tree | e05528220d4f3726b6283e5c673ce3def070552e /test | |
parent | f91b944cabf7be9aadb40ffe35fce76b50f5f25f (diff) | |
download | jquery-1a14a38ff77839b2a71fbc3f3c0890ebe62438c7.tar.gz jquery-1a14a38ff77839b2a71fbc3f3c0890ebe62438c7.zip |
Make sure original context is maintained and not the deep extended one. Fixes #5924.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/ajax.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 775523e58..195fa27ca 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(); |