diff options
author | jaubourg <j@ubourg.net> | 2011-07-23 02:39:12 +0200 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2011-07-23 02:39:12 +0200 |
commit | 0ed99097bda3bb6e302c3d93331f0e7312e42077 (patch) | |
tree | 2467b13e4e09753f5f81059f0f14965206120879 /test/unit/ajax.js | |
parent | 1d220cdd55ec09cd46c594f154d11e7ba9d14b66 (diff) | |
download | jquery-0ed99097bda3bb6e302c3d93331f0e7312e42077.tar.gz jquery-0ed99097bda3bb6e302c3d93331f0e7312e42077.zip |
Fixes #9854: propagates native statusText onto jqXHR.statusText. statusText in callbacks is still normalized. Unit test added.
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r-- | test/unit/ajax.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 6af56db4f..ed6acda92 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -2092,6 +2092,19 @@ test( "jQuery.ajax - Context with circular references (#9887)", 2, function () { ok( success, "context with circular reference did not generate an exception" ); }); +test( "jQuery.ajax - statusText" , 4, function() { + stop(); + jQuery.ajax( url( "data/statusText.php?status=200&text=Hello" ) ).done(function( _, statusText, jqXHR ) { + strictEqual( statusText, "success", "callback status text ok for success" ); + strictEqual( jqXHR.statusText, "Hello", "jqXHR status text ok for success" ); + jQuery.ajax( url( "data/statusText.php?status=404&text=World" ) ).fail(function( jqXHR, statusText ) { + strictEqual( statusText, "error", "callback status text ok for error" ); + strictEqual( jqXHR.statusText, "World", "jqXHR status text ok for error" ); + start(); + }); + }); +}); + test( "jQuery.ajax - statusCode" , function() { var count = 12; |