There was a disabled test in the ajax test suite which said there were too many simul...
[jquery.git] / test / unit / ajax.js
index 162650f..2b3cfb6 100644 (file)
@@ -218,23 +218,21 @@ test("synchronous request with callbacks", function() {
 });
 
 test("pass-through request object", function() {
-       expect(1);
+       expect(6);
        stop(true);
        
        var target = "data/name.html";
        var count = 0;
        var success = function() {
-               // Disabled
-               //if(count++ == 5)
+               // Re-enabled because a bug was found in the unit test that probably caused the problem
+               if(++count == 5)
                start();
        };
        
-       /* Test disabled, too many simultaneous requests
        ok( $.get(url(target), success), "get" );
        ok( $.post(url(target), success), "post" );
        ok( $.getScript(url("data/test.js"), success), "script" );
        ok( $.getJSON(url("data/json_obj.js"), success), "json" );
-       */
        ok( $.ajax({url: url(target), success: success}), "generic" );
 });
 
@@ -513,6 +511,19 @@ test("$.getJSON(String, Function) - JSON object", function() {
        });
 });
 
+test("$.getJSON(String, Function) - Remote JSON object with assignment", function() {
+       expect(2);
+
+       var base = window.location.href.replace(/\?.*$/, "");
+
+       stop();
+       $.getJSON(base + "data/json_assigned_obj.js", function() {
+         ok( typeof json_assigned_obj == "object", 'Check JSON loaded' );
+         equals( json_assigned_obj.test, "worked", 'Check JSON obj.test' );
+         start();
+       });
+});
+
 test("$.post(String, Hash, Function) - simple with xml", function() {
        expect(4);
        stop();