aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/unit/ajax.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index 125470519..fe831d0b1 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -810,6 +810,19 @@ QUnit.module( "ajax", {
};
} );
+ ajaxTest( "jQuery.ajax() - do execute scripts if JSONP from unsuccessful responses", 1, function( assert ) {
+ var testMsg = "Unsuccessful JSONP requests should have a JSON body";
+ return {
+ dataType: "jsonp",
+ url: url( "mock.php?action=errorWithScript" ),
+ // error is the significant assertion
+ error: function( xhr ) {
+ var expected = { "status": 404, "msg": "Not Found" };
+ assert.deepEqual( xhr.responseJSON, expected, testMsg );
+ }
+ };
+ } );
+
ajaxTest( "jQuery.ajax() - do not execute scripts from unsuccessful responses (gh-4250)", 11, function( assert ) {
var globalEval = jQuery.globalEval;