mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Tests: Make Ajax tests pass in iOS 9
Accept "HTTP/2.0 200" as a valid `statusText` for successful requests to make ajax tests pass in iOS 9. At this point, normalizing this in code doesn't seem to make a lot of sense. Closes gh-5121
This commit is contained in:
parent
c0db6d7032
commit
d051e0e3a2
@ -1640,8 +1640,14 @@ QUnit.module( "ajax", {
|
||||
var done = assert.async();
|
||||
jQuery.ajax( url( "mock.php?action=status&code=200&text=Hello" ) ).done( function( _, statusText, jqXHR ) {
|
||||
assert.strictEqual( statusText, "success", "callback status text ok for success" );
|
||||
assert.ok( [ "Hello", "OK", "success" ].indexOf( jqXHR.statusText ) > -1,
|
||||
|
||||
// Support: iOS 9 only
|
||||
// Some versions of iOS 9 return the "HTTP/2.0 200" status text
|
||||
// in this case; accept it.
|
||||
assert.ok(
|
||||
[ "Hello", "OK", "success", "HTTP/2.0 200" ].indexOf( jqXHR.statusText ) > -1,
|
||||
"jqXHR status text ok for success (" + jqXHR.statusText + ")" );
|
||||
|
||||
jQuery.ajax( url( "mock.php?action=status&code=404&text=World" ) ).fail( function( jqXHR, statusText ) {
|
||||
assert.strictEqual( statusText, "error", "callback status text ok for error" );
|
||||
done();
|
||||
|
Loading…
Reference in New Issue
Block a user