Github
This repository
This repository
All repositories
Browse code

228ab3d followup 1: fix test failures. Close gh-1056.

  • Loading branch information...
commit c077035b65feeb0703173908aa25ddf98dedee2c 1 parent 4008a98
authored jaubourg committed
8  test/data/testinit.js
... ... @@ -64,11 +64,11 @@ function createComplexHTML() {
64 64    testFoo = "foo"; jQuery("#foo").html("foo"); \
65 65    ok( true, "inline script executed" ); \
66 66    /* ]]> */</script> \
67   -  <script src="' + service("echo", {
  67 +  <script src="' + service("echo/", {
68 68      content: 'var testBar = "bar"; \
69 69      jQuery("#ap").html("bar"); \
70 70      ok( true, "remote script executed");'
71   -  }) + '"></script> \
  71 +  }).replace( /&/g, "&amp;" ) + '"></script> \
72 72    blabla';
73 73  }
74 74  
... ... @@ -158,10 +158,10 @@ function url( value ) {
158 158  }
159 159  
160 160  function service( value, data ) {
161   -  var fragment = url( "data/ajax/" + ( value || "" ) );
  161 +  var fragment = url( "data/ajax/" + value );
162 162    if ( data ) {
163 163      if ( typeof data !== "string" ) {
164   -      data = jQuery.param( data );
  164 +      data = jQuery.param( data, false );
165 165      }
166 166      fragment += "&" + data;
167 167    }
167  test/unit/ajax.js
... ... @@ -32,7 +32,7 @@ module( "ajax", {
32 32  
33 33    ajaxTest( "jQuery.ajax() - GET", 1, {
34 34      type: "GET",
35   -    url: service("echo"),
  35 +    url: service("echo/"),
36 36      data: {
37 37        content: "bar"
38 38      },
... ... @@ -63,7 +63,7 @@ module( "ajax", {
63 63  
64 64    ajaxTest( "jQuery.ajax() - success", 8, {
65 65      setup: addGlobalEvents("ajaxStart ajaxStop ajaxSend ajaxComplete ajaxSuccess"),
66   -    url: service("echo"),
  66 +    url: service("echo/"),
67 67      beforeSend: function() {
68 68        ok( true, "beforeSend" );
69 69      },
... ... @@ -78,7 +78,7 @@ module( "ajax", {
78 78    ajaxTest( "jQuery.ajax() - success - (url, options)", 8, {
79 79      setup: addGlobalEvents("ajaxStart ajaxStop ajaxSend ajaxComplete ajaxSuccess"),
80 80      create: function( options ) {
81   -      return jQuery.ajax( service("echo"), options );
  81 +      return jQuery.ajax( service("echo/"), options );
82 82      },
83 83      beforeSend: function() {
84 84        ok( true, "beforeSend" );
... ... @@ -93,7 +93,7 @@ module( "ajax", {
93 93  
94 94    ajaxTest( "jQuery.ajax() - success - late binding", 8, {
95 95      setup: addGlobalEvents("ajaxStart ajaxStop ajaxSend ajaxComplete ajaxSuccess"),
96   -    url: service("echo"),
  96 +    url: service("echo/"),
97 97      beforeSend: function() {
98 98        ok( true, "beforeSend" );
99 99      },
... ... @@ -111,7 +111,7 @@ module( "ajax", {
111 111  
112 112    ajaxTest( "jQuery.ajax() - success - oncomplete binding", 8, {
113 113      setup: addGlobalEvents("ajaxStart ajaxStop ajaxSend ajaxComplete ajaxSuccess"),
114   -    url: service("echo"),
  114 +    url: service("echo/"),
115 115      beforeSend: function() {
116 116        ok( true, "beforeSend" );
117 117      },
... ... @@ -129,7 +129,7 @@ module( "ajax", {
129 129  
130 130    ajaxTest( "jQuery.ajax() - error", 8, {
131 131      setup: addGlobalEvents("ajaxStart ajaxStop ajaxSend ajaxComplete ajaxError"),
132   -    url: service("error"),
  132 +    url: service("error/"),
133 133      beforeSend: function() {
134 134        ok( true, "beforeSend" );
135 135      },
... ... @@ -143,7 +143,7 @@ module( "ajax", {
143 143  
144 144    ajaxTest( "jQuery.ajax() - abort - textStatus and errorThrown values", 4, [
145 145      {
146   -      url: service("echo"),
  146 +      url: service("echo/"),
147 147        data: {
148 148          delay: 1
149 149        },
... ... @@ -156,7 +156,7 @@ module( "ajax", {
156 156        }
157 157      },
158 158      {
159   -      url: service("echo"),
  159 +      url: service("echo/"),
160 160        data: {
161 161          delay: 1
162 162        },
... ... @@ -171,7 +171,7 @@ module( "ajax", {
171 171    ]);
172 172  
173 173    ajaxTest( "jQuery.ajax() - error - responseText", 1, {
174   -    url: service("echo"),
  174 +    url: service("echo/"),
175 175      data: {
176 176        status: 400,
177 177        content: "plain text message"
... ... @@ -185,7 +185,7 @@ module( "ajax", {
185 185      var previousUrl,
186 186        firstTime = true;
187 187      jQuery.ajax({
188   -      url: service("error"),
  188 +      url: service("error/"),
189 189        error: function() {
190 190          if ( firstTime ) {
191 191            firstTime = false;
... ... @@ -193,7 +193,7 @@ module( "ajax", {
193 193          } else {
194 194            ok ( true, "Test retrying with jQuery.ajax(this) works" );
195 195            jQuery.ajax({
196   -            url: service("error"),
  196 +            url: service("error/"),
197 197              data: {
198 198                "x": 1
199 199              },
... ... @@ -221,7 +221,7 @@ module( "ajax", {
221 221          xhr.setRequestHeader( "ajax-send", "test" );
222 222        });
223 223      },
224   -    url: service("headers/request"),
  224 +    url: service("headers/request/"),
225 225      data: {
226 226        headers: "siMPle,SometHing-elsE,OthEr,ajax-send"
227 227      },
... ... @@ -251,7 +251,7 @@ module( "ajax", {
251 251          xhr.setRequestHeader( "ajax-send", "test" );
252 252        });
253 253      },
254   -    url: service("headers/response"),
  254 +    url: service("headers/response/"),
255 255      data: {
256 256        "Sample-Header": "sample value",
257 257        "Sample-Header2": "sample value 2",
... ... @@ -271,7 +271,7 @@ module( "ajax", {
271 271    });
272 272  
273 273    ajaxTest( "jQuery.ajax() - headers - Accept", 1, {
274   -    url: service("headers/request"),
  274 +    url: service("headers/request/"),
275 275      data: {
276 276        headers: "accept"
277 277      },
... ... @@ -288,7 +288,7 @@ module( "ajax", {
288 288  
289 289    ajaxTest( "jQuery.ajax() - headers - contentType option", 2, [
290 290      {
291   -      url: service("headers/request"),
  291 +      url: service("headers/request/"),
292 292        data: {
293 293          headers: "content-type"
294 294        },
... ... @@ -298,7 +298,7 @@ module( "ajax", {
298 298        }
299 299      },
300 300      {
301   -      url: service("headers/request"),
  301 +      url: service("headers/request/"),
302 302        data: {
303 303          headers: "content-type"
304 304        },
... ... @@ -404,7 +404,7 @@ module( "ajax", {
404 404  
405 405    ajaxTest( "jQuery.ajax() - abort", 9, {
406 406      setup: addGlobalEvents("ajaxStart ajaxStop ajaxSend ajaxError ajaxComplete"),
407   -    url: service("echo"),
  407 +    url: service("echo/"),
408 408      data: {
409 409        delay: 1
410 410      },
... ... @@ -452,12 +452,12 @@ module( "ajax", {
452 452          }, 0 );
453 453        },
454 454        requests: [{
455   -        url: service("echo"),
  455 +        url: service("echo/"),
456 456          beforeSend: callback("beforeSend"),
457 457          success: callback("success"),
458 458          complete: callback("complete")
459 459        }, {
460   -        url: service("error"),
  460 +        url: service("error/"),
461 461          beforeSend: callback("beforeSend"),
462 462          error: callback("error"),
463 463          complete: callback("complete")
... ... @@ -472,7 +472,7 @@ module( "ajax", {
472 472        };
473 473      }
474 474      return {
475   -      url: service("error"),
  475 +      url: service("error/"),
476 476        beforeSend: nocallback("beforeSend"),
477 477        error: nocallback("error"),
478 478        complete:  nocallback("complete")
... ... @@ -480,7 +480,7 @@ module( "ajax", {
480 480    });
481 481  
482 482    ajaxTest( "jQuery.ajax() - context - modification", 1, {
483   -    url: service("error"),
  483 +    url: service("error/"),
484 484      context: {},
485 485      beforeSend: function() {
486 486        this.test = "foo";
... ... @@ -501,12 +501,12 @@ module( "ajax", {
501 501          strictEqual( jQuery.ajaxSettings.context, obj, "Make sure the context is properly set in ajaxSettings." );
502 502        },
503 503        requests: [{
504   -        url: service("error"),
  504 +        url: service("error/"),
505 505          error: function() {
506 506            strictEqual( this, obj, "Make sure the original object is maintained." );
507 507          }
508 508        }, {
509   -        url: service("error"),
  509 +        url: service("error/"),
510 510          context: {},
511 511          error: function() {
512 512            ok( this !== obj, "Make sure overidding context is possible." );
... ... @@ -518,7 +518,7 @@ module( "ajax", {
518 518    ajaxTest( "jQuery.ajax() - events - disable", 3, {
519 519      setup: addGlobalEvents(""),
520 520      global: false,
521   -    url: service("echo"),
  521 +    url: service("echo/"),
522 522      beforeSend: function() {
523 523        ok( true, "beforeSend" );
524 524      },
... ... @@ -531,7 +531,7 @@ module( "ajax", {
531 531    });
532 532  
533 533    ajaxTest( "jQuery.ajax() - xml - non-namespace elements inside namespaced elements", 3, {
534   -    url: service("echo"),
  534 +    url: service("echo/"),
535 535      data: {
536 536        contentType: "text/xml",
537 537        content: createWithFriesXML( true )
... ... @@ -544,7 +544,7 @@ module( "ajax", {
544 544    });
545 545  
546 546    ajaxTest( "jQuery.ajax() - xml - non-namespace elements inside namespaced elements (over JSONP)", 3, {
547   -    url: service("echo"),
  547 +    url: service("echo/"),
548 548      data: {
549 549        content: createWithFriesXML( true )
550 550      },
... ... @@ -557,7 +557,7 @@ module( "ajax", {
557 557    });
558 558  
559 559    ajaxTest( "jQuery.ajax() - atom+xml", 2, {
560   -    url: service("echo"),
  560 +    url: service("echo/"),
561 561      data: {
562 562        content: "<root><element /></root>",
563 563        contentType: "atom+xml"
... ... @@ -588,7 +588,7 @@ module( "ajax", {
588 588    });
589 589  
590 590    ajaxTest( "jQuery.ajax() - beforeSend", 1, {
591   -    url: service("error"),
  591 +    url: service("error/"),
592 592      beforeSend: function( xml ) {
593 593        this.check = true;
594 594      },
... ... @@ -600,7 +600,7 @@ module( "ajax", {
600 600    ajaxTest( "jQuery.ajax() - beforeSend, cancel request manually", 2, {
601 601      create: function() {
602 602        return jQuery.ajax({
603   -        url: service("error"),
  603 +        url: service("error/"),
604 604          beforeSend: function( xhr ) {
605 605            ok( true, "beforeSend got called, canceling" );
606 606            xhr.abort();
... ... @@ -627,7 +627,7 @@ module( "ajax", {
627 627        Globals.register("testBar");
628 628      },
629 629      dataType: "html",
630   -    url: service("echo"),
  630 +    url: service("echo/"),
631 631      data: {
632 632        content: createComplexHTML()
633 633      },
... ... @@ -640,7 +640,7 @@ module( "ajax", {
640 640    });
641 641  
642 642    ajaxTest( "jQuery.ajax() - synchronous request", 1, {
643   -    url: service("echo"),
  643 +    url: service("echo/"),
644 644      data: {
645 645        content: "hello world"
646 646      },
... ... @@ -653,7 +653,7 @@ module( "ajax", {
653 653    });
654 654  
655 655    ajaxTest( "jQuery.ajax() - synchronous request - callbacks", 2, {
656   -    url: service("echo"),
  656 +    url: service("echo/"),
657 657      data: {
658 658        content: "hello world"
659 659      },
... ... @@ -687,12 +687,12 @@ module( "ajax", {
687 687        start();
688 688      });
689 689  
690   -    ok( jQuery.get( service("echo"), success ), "get" );
691   -    ok( jQuery.post( service("echo"), success ), "post" );
692   -    ok( jQuery.getScript( service("echo"), success ), "script" );
693   -    ok( jQuery.getJSON( service("echo?content=0"), success ), "json" );
  690 +    ok( jQuery.get( service("echo/"), success ), "get" );
  691 +    ok( jQuery.post( service("echo/"), success ), "post" );
  692 +    ok( jQuery.getScript( service("echo/"), success ), "script" );
  693 +    ok( jQuery.getJSON( service("echo/?content=0"), success ), "json" );
694 694      ok( jQuery.ajax({
695   -      url: service("echo"),
  695 +      url: service("echo/"),
696 696        success: success
697 697      }), "generic" );
698 698    });
... ... @@ -759,7 +759,7 @@ module( "ajax", {
759 759              strictEqual( data, "041275", "JSON results returned - " + this.type + " - " + options.title );
760 760            }
761 761          }, options );
762   -      tmp.url = service( "echo" + ( options.url || "" ) );
  762 +      tmp.url = service( "echo/" + ( options.url || "" ) );
763 763        return tmp;
764 764      }
765 765  
... ... @@ -774,11 +774,11 @@ module( "ajax", {
774 774        }),
775 775        request({
776 776          title: "REST-like",
777   -        url: "/index.php/??"
  777 +        url: "index.php/??"
778 778        }),
779 779        request({
780 780          title: "REST-like (with param)",
781   -        url: "/index.php/???content=\"041275\"",
  781 +        url: "index.php/???content=\"041275\"",
782 782          beforeSend: function() {
783 783            delete this.data;
784 784          }
... ... @@ -848,19 +848,16 @@ module( "ajax", {
848 848      ajaxTest( "jQuery.ajax() - JSONP - POST" + label, 3, [
849 849        request({
850 850          title: "no callback",
851   -        type: "POST",
852   -        url: "/"
  851 +        type: "POST"
853 852        }),
854 853        request({
855 854          title: "data callback",
856 855          type: "POST",
857   -        url: "/",
858 856          data: "content=041275&callback=?"
859 857        }),
860 858        request({
861 859          title: "data obj callback",
862 860          type: "POST",
863   -        url: "/",
864 861          jsonp: "callback"
865 862        })
866 863      ]);
... ... @@ -929,7 +926,7 @@ module( "ajax", {
929 926    });
930 927  
931 928    ajaxTest( "jQuery.ajax() - malformed JSON", 2, {
932   -    url: service("echo"),
  929 +    url: service("echo/"),
933 930      data: {
934 931        content: "{bad: toTheBone}"
935 932      },
... ... @@ -947,7 +944,7 @@ module( "ajax", {
947 944          return 42;
948 945        }
949 946      },
950   -    url: service("headers/response/index.php"),
  947 +    url: service("headers/response/"),
951 948      data: {
952 949        "Content-Type": "application/json"
953 950      },
... ... @@ -962,7 +959,7 @@ module( "ajax", {
962 959          ok( false, "content-type detected" );
963 960        }
964 961      },
965   -    url: service("headers/response/index.php"),
  962 +    url: service("headers/response/"),
966 963      data: {
967 964        "Content-Type": "application/json"
968 965      },
... ... @@ -975,7 +972,7 @@ module( "ajax", {
975 972    });
976 973  
977 974    ajaxTest( "jQuery.ajax() - JSON - empty", 1, {
978   -    url: service("echo"),
  975 +    url: service("echo/"),
979 976      dataType: "json",
980 977      error: function( _, __, error ) {
981 978        strictEqual( typeof error, "object", "error object for empty json response" );
... ... @@ -1037,7 +1034,7 @@ module( "ajax", {
1037 1034  
1038 1035    ajaxTest( "jQuery.ajax() - statusText", 4, [
1039 1036      {
1040   -      url: service("echo"),
  1037 +      url: service("echo/"),
1041 1038        data: {
1042 1039          status: 200,
1043 1040          statusText: "Hello"
... ... @@ -1048,7 +1045,7 @@ module( "ajax", {
1048 1045        }
1049 1046      },
1050 1047      {
1051   -      url: service("echo"),
  1048 +      url: service("echo/"),
1052 1049        data: {
1053 1050          status: 404,
1054 1051          statusText: "Hello"
... ... @@ -1060,7 +1057,7 @@ module( "ajax", {
1060 1057      }
1061 1058    ]);
1062 1059  
1063   -  jQuery.each( [ "error", service("echo") ], function( isSuccess, url ) {
  1060 +  jQuery.each( [ service("error/"), service("echo/") ], function( isSuccess, url ) {
1064 1061      function statusCodes( title ) {
1065 1062        return {
1066 1063          200: function() {
... ... @@ -1102,7 +1099,7 @@ module( "ajax", {
1102 1099          dataType = srcType + " " + dataType;
1103 1100        }
1104 1101        return {
1105   -        url: service("echo"),
  1102 +        url: service("echo/"),
1106 1103          data: {
1107 1104            content: "\"041275\""
1108 1105          },
... ... @@ -1124,7 +1121,7 @@ module( "ajax", {
1124 1121  
1125 1122    ajaxTest( "jQuery.ajax() - overrideMimeType", 2, [
1126 1123      {
1127   -      url: service("echo"),
  1124 +      url: service("echo/"),
1128 1125        data: {
1129 1126          content: "42"
1130 1127        },
... ... @@ -1136,7 +1133,7 @@ module( "ajax", {
1136 1133        }
1137 1134      },
1138 1135      {
1139   -      url: service("echo"),
  1136 +      url: service("echo/"),
1140 1137        data: {
1141 1138          content: "42"
1142 1139        },
... ... @@ -1171,7 +1168,7 @@ module( "ajax", {
1171 1168    });
1172 1169  
1173 1170    ajaxTest( "#2806 - jQuery.ajax() - data option - evaluate function values", 1, {
1174   -    url: service("echo"),
  1171 +    url: service("echo/"),
1175 1172      data: {
1176 1173        content: function() {
1177 1174          return "value";
... ... @@ -1219,7 +1216,7 @@ module( "ajax", {
1219 1216      },
1220 1217      {
1221 1218        create: function() {
1222   -        return jQuery.ajax( service("echo") );
  1219 +        return jQuery.ajax( service("echo/") );
1223 1220        },
1224 1221        done: function() {
1225 1222          ok( true, "With only string URL argument" );
... ... @@ -1227,7 +1224,7 @@ module( "ajax", {
1227 1224      },
1228 1225      {
1229 1226        create: function() {
1230   -        return jQuery.ajax( service("echo"), {});
  1227 +        return jQuery.ajax( service("echo/"), {});
1231 1228        },
1232 1229        done: function() {
1233 1230          ok( true, "With string URL param and map" );
... ... @@ -1237,7 +1234,7 @@ module( "ajax", {
1237 1234        create: function( options ) {
1238 1235          return jQuery.ajax( options );
1239 1236        },
1240   -      url: service("echo"),
  1237 +      url: service("echo/"),
1241 1238        success: function() {
1242 1239          ok( true, "With only map" );
1243 1240        }
... ... @@ -1246,7 +1243,7 @@ module( "ajax", {
1246 1243    
1247 1244    jQuery.each( [ " - Same Domain", " - Cross Domain" ], function( crossDomain, label ) {
1248 1245      ajaxTest( "#8205 - jQuery.ajax() - JSONP - re-use callbacks name" + label, 2, {
1249   -      url: service("echo"),
  1246 +      url: service("echo/"),
1250 1247        data: {
1251 1248          content: "42"
1252 1249        },
... ... @@ -1321,7 +1318,7 @@ module( "ajax", {
1321 1318    test( "#11743 - jQuery.ajax() - script, throws exception", 1, function() {
1322 1319      raises(function() {
1323 1320        jQuery.ajax({
1324   -        url: service("echo"),
  1321 +        url: service("echo/"),
1325 1322          data: {
1326 1323            content: "SYNTAX ERROR"
1327 1324          },
... ... @@ -1345,7 +1342,7 @@ module( "ajax", {
1345 1342  
1346 1343      function request( option ) {
1347 1344        var options = {
1348   -          url: service("echo/index.php"),
  1345 +          url: service("echo/"),
1349 1346            data: {
1350 1347              requestArray: "POST",
1351 1348              content: "hello"
... ... @@ -1401,7 +1398,7 @@ module( "ajax", {
1401 1398  
1402 1399    asyncTest( "jQuery.ajaxSetup()", 1, function() {
1403 1400      jQuery.ajaxSetup({
1404   -      url: service("echo"),
  1401 +      url: service("echo/"),
1405 1402        data: {
1406 1403          content: "bar"
1407 1404        },
... ... @@ -1420,7 +1417,7 @@ module( "ajax", {
1420 1417          timeout: 50
1421 1418        });
1422 1419      },
1423   -    url: service("echo?delay=1"),
  1420 +    url: service("echo/?delay=1"),
1424 1421      error: function( _, status ) {
1425 1422        strictEqual( status, "timeout", "timed out" );
1426 1423      }
... ... @@ -1434,7 +1431,7 @@ module( "ajax", {
1434 1431      },
1435 1432      type: "GET",
1436 1433      timeout: 15000,
1437   -    url: service("echo?delay=1"),
  1434 +    url: service("echo/?delay=1"),
1438 1435      success: function() {
1439 1436        ok( true, "Check for local timeout" );
1440 1437      }
... ... @@ -1451,14 +1448,14 @@ module( "ajax", {
1451 1448        ok( false, "Global event triggered" );
1452 1449      });
1453 1450  
1454   -    jQuery("#qunit-fixture").append("<script src='" + service( "echo", {
  1451 +    jQuery("#qunit-fixture").append("<script src='" + service( "echo/", {
1455 1452        requestArray: "GET",
1456 1453        content: "ok( true, \"script executed\" );"
1457 1454      }) + "'></script>");
1458 1455    });
1459 1456  
1460 1457    asyncTest( "#11402 - jQuery.domManip() - script in comments are properly evaluated", 2, function() {
1461   -    jQuery("#qunit-fixture").load( service( "echo", {
  1458 +    jQuery("#qunit-fixture").load( service( "echo/", {
1462 1459        content:
1463 1460          "<script>\n<!--\nok( true, \"script within html comments executed\" );\n-->\n</script>\n" +
1464 1461          "<script>\n<![CDATA[\nok( true, \"script within CDATA executed\" );\n]]>\n</script>"
... ... @@ -1469,7 +1466,7 @@ module( "ajax", {
1469 1466  
1470 1467    asyncTest( "jQuery.get( String, Hash, Function ) - parse xml and use text() on nodes", 2, function() {
1471 1468      var tabs = [ "blabla", "blublu" ];
1472   -    jQuery.get( service( "echo", {
  1469 +    jQuery.get( service( "echo/", {
1473 1470        contentType: "text/xml",
1474 1471        content: createDashboardXML( true )
1475 1472      }), function( xml ) {
... ... @@ -1486,7 +1483,7 @@ module( "ajax", {
1486 1483          content: "helloworld"
1487 1484        }
1488 1485      });
1489   -    jQuery.get( service("echo"), function( data ) {
  1486 +    jQuery.get( service("echo/"), function( data ) {
1490 1487        strictEqual( data, "helloworld", "Data from ajaxSettings was used" );
1491 1488        start();
1492 1489      });
... ... @@ -1496,7 +1493,7 @@ module( "ajax", {
1496 1493  
1497 1494    asyncTest( "jQuery.getJSON( String, Hash, Function ) - JSON array", 1, function() {
1498 1495      jQuery.getJSON(
1499   -      service("echo"),
  1496 +      service("echo/"),
1500 1497        {
1501 1498          "content": "[{ \"name\": \"John\", \"age\": 21 }, { \"name\": \"Peter\", \"age\": 25 }]"
1502 1499        },
... ... @@ -1514,7 +1511,7 @@ module( "ajax", {
1514 1511    });
1515 1512  
1516 1513    asyncTest( "jQuery.getJSON( String, Function ) - JSON object", 1, function() {
1517   -    jQuery.getJSON( service( "echo", {
  1514 +    jQuery.getJSON( service( "echo/", {
1518 1515        content: "{ \"data\": { \"lang\": \"en\", \"length\": 25 } }"
1519 1516      }), function( json ) {
1520 1517        deepEqual( json, {
... ... @@ -1540,14 +1537,14 @@ module( "ajax", {
1540 1537          return true;
1541 1538        }
1542 1539      };
1543   -    jQuery.getJSON( service("echo"), function( json ) {
  1540 +    jQuery.getJSON( service("echo/"), function( json ) {
1544 1541        strictEqual( json, true, "Verifying return value" );
1545 1542        start();
1546 1543      });
1547 1544    });
1548 1545  
1549 1546    asyncTest( "jQuery.getJSON( String, Function ) - JSON object with absolute url to local content", 1, function() {
1550   -    jQuery.getJSON( window.location.href.replace( /[^\/]*$/, "" ) + service( "echo", {
  1547 +    jQuery.getJSON( window.location.href.replace( /[^\/]*$/, "" ) + service( "echo/", {
1551 1548        content: "{ \"data\": { \"lang\": \"en\", \"length\": 25 } }"
1552 1549      }), function( json ) {
1553 1550        deepEqual( json, {
... ... @@ -1564,7 +1561,7 @@ module( "ajax", {
1564 1561  
1565 1562    asyncTest( "jQuery.getScript( String, Function ) - with callback", 2, function() {
1566 1563      Globals.register("testBar");
1567   -    jQuery.getScript( service("echo", {
  1564 +    jQuery.getScript( service("echo/", {
1568 1565        content: "var testBar = \"bar\"; ok( true, \"script executed\");"
1569 1566      }), function( data, _, jqXHR ) {
1570 1567        strictEqual( testBar, "bar", "Check if script was evaluated" );
... ... @@ -1574,14 +1571,14 @@ module( "ajax", {
1574 1571  
1575 1572    asyncTest( "jQuery.getScript( String, Function ) - no callback", 1, function() {
1576 1573      Globals.register("testBar");
1577   -    jQuery.getScript( service("echo", {
  1574 +    jQuery.getScript( service("echo/", {
1578 1575        content: "var testBar = \"bar\"; ok( true, \"script executed\");"
1579 1576      }) ).done( start );
1580 1577    });
1581 1578  
1582 1579    asyncTest( "#8082 - jQuery.getScript( String, Function ) - source as responseText", 2, function() {
1583 1580      Globals.register("testBar");
1584   -    jQuery.getScript( service("echo", {
  1581 +    jQuery.getScript( service("echo/", {
1585 1582        content: "var testBar = \"bar\"; ok( true, \"script executed\");"
1586 1583      }), function( data, _, jqXHR ) {
1587 1584        strictEqual( data, jqXHR.responseText, "Same-domain script requests returns the source of the script" );
... ... @@ -1598,7 +1595,7 @@ module( "ajax", {
1598 1595          strictEqual( this.type, "GET", "no data means GET request" );
1599 1596        }
1600 1597      });
1601   -    jQuery("#first").load( service( "echo", {
  1598 +    jQuery("#first").load( service( "echo/", {
1602 1599        content: "<script>ok( true, \"html injected\" )</script>"
1603 1600      }), start );
1604 1601    });
... ... @@ -1618,7 +1615,7 @@ module( "ajax", {
1618 1615          strictEqual( this.type, "GET", "null data means GET request" );
1619 1616        }
1620 1617      });
1621   -    jQuery("#first").load(  service( "echo", {
  1618 +    jQuery("#first").load(  service( "echo/", {
1622 1619        content: "<script>ok( true, \"html injected\" )</script>"
1623 1620      }), null, start );
1624 1621    });
... ... @@ -1630,14 +1627,14 @@ module( "ajax", {
1630 1627          strictEqual( this.type, "GET", "undefined data means GET request" );
1631 1628        }
1632 1629      });
1633   -    jQuery("#first").load(  service( "echo", {
  1630 +    jQuery("#first").load(  service( "echo/", {
1634 1631        content: "<script>ok( true, \"html injected\" )</script>"
1635 1632      }), undefined, start );
1636 1633    });
1637 1634  
1638 1635    // check if load can be called with only url
1639 1636    asyncTest( "jQuery.fn.load( URL_SELECTOR )", 1, function() {
1640   -    jQuery("#first").load( service("echo", {
  1637 +    jQuery("#first").load( service("echo/", {
1641 1638        content: "<div class=\"user\"></div><div class=\"user\"></div><div></div>"
1642 1639      }) + " div.user", function() {
1643 1640        strictEqual( jQuery( this ).children("div").length, 2, "Verify that specific elements were injected" );
... ... @@ -1646,7 +1643,7 @@ module( "ajax", {
1646 1643    });
1647 1644  
1648 1645    asyncTest( "jQuery.fn.load( String, Function ) - simple: inject text into DOM", 2, function() {
1649   -    jQuery("#first").load( service( "echo", {
  1646 +    jQuery("#first").load( service( "echo/", {
1650 1647        content: "INJECTED<script>ok( true, \"html injected\" )</script>"
1651 1648      }), function() {
1652 1649        ok( /^INJECTED/.test(jQuery("#first").text()), "Check if content was injected into the DOM" );
... ... @@ -1664,7 +1661,7 @@ module( "ajax", {
1664 1661      Globals.register("testFoo");
1665 1662      Globals.register("testBar");
1666 1663  
1667   -    jQuery("#first").load( service( "echo", {
  1664 +    jQuery("#first").load( service( "echo/", {
1668 1665        content: createComplexHTML()
1669 1666      }), function() {
1670 1667        ok( jQuery("#first").html().match( /^html text/ ), "Check content after loading html" );
... ... @@ -1675,7 +1672,7 @@ module( "ajax", {
1675 1672    });
1676 1673  
1677 1674    asyncTest( "jQuery.fn.load( String, Function ) - check file with only a script tag", 3, function() {
1678   -    jQuery("#first").load( service("echo", {
  1675 +    jQuery("#first").load( service("echo/", {
1679 1676        content: "<script>var testFoo = \"foo\"; jQuery(\"#foo\").html(\"foo\"); ok( true, \"script executed\" );</script>"
1680 1677      }), function() {
1681 1678        strictEqual( jQuery("#foo").html(), "foo", "Check if script evaluation has modified DOM");
... ... @@ -1690,7 +1687,7 @@ module( "ajax", {
1690 1687          return "Hello World";
1691 1688        }
1692 1689      });
1693   -    jQuery("<div/>").load( service("echo"), function( responseText ) {
  1690 +    jQuery("<div/>").load( service("echo/"), function( responseText ) {
1694 1691        strictEqual( jQuery( this ).html(), "Hello World", "Test div was filled with filtered data" );
1695 1692        strictEqual( responseText, "Hello World", "Test callback receives filtered data" );
1696 1693        start();
... ... @@ -1735,7 +1732,7 @@ module( "ajax", {
1735 1732        jQuery.map([
1736 1733          {
1737 1734            type: "success",
1738   -          url: service("echo")
  1735 +          url: service("echo/")
1739 1736          },
1740 1737          {
1741 1738            type: "error",
... ... @@ -1765,7 +1762,7 @@ module( "ajax", {
1765 1762        strictEqual( s.dataType, "html", "Verify the load() dataType was html" );
1766 1763        start();
1767 1764      });
1768   -    jQuery("#first").load( service("echo") );
  1765 +    jQuery("#first").load( service("echo/") );
1769 1766    });
1770 1767  
1771 1768    test( "#10524 - jQuery.fn.load() - data specified in ajaxSettings is merged in", 1, function() {

0 notes on commit c077035

Please sign in to comment.
Something went wrong with that request. Please try again.