X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fajax.js;h=fbff2d82e535a339602ec72e230b97738368f815;hb=90a87c03b4943d75c24bc5e6246630231d12d933;hp=5a95921fadd46f853a0fd3c815052d997c30d805;hpb=a0451f162e95b552f9dc307b8529c114edeab417;p=jquery.git diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 5a95921..fbff2d8 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -693,6 +693,25 @@ test("jQuery.getJSON(String, Function) - JSON object", function() { }); }); +test("jQuery.getJSON - Using Native JSON", function() { + expect(2); + + var old = window.JSON; + JSON = { + parse: function(str){ + ok( true, "Verifying that parse method was run" ); + return true; + } + }; + + stop(); + jQuery.getJSON(url("data/json.php"), function(json) { + window.JSON = old; + equals( json, true, "Verifying return value" ); + start(); + }); +}); + test("jQuery.getJSON(String, Function) - JSON object with absolute url to local content", function() { expect(2);