I'm trying to write a bunch of unit tests for all of my different ajax request states (Complete, Error, Success), my main issue is that only my first request test fires. If I remove the first test, then the second test will fire. Any idea? I figure since they are asynchronous, they should fire at the same time....
module("AJAX Request");
asyncTest("request_data_success", 1, function () {
$.ajax({
url: "https://www.googleapis.com/plus/v1/people/104949285507985198959/",
dataType: 'jsonp',
async: false,
success: function (data, status, jqXHR) {
ok(true, "Success");
start();
}
});
});
asyncTest("request_data_failure", 1, function () {
$.ajax({
url: "https://www.googleapis.com/plus/v1/people/104949285507985198959/",
dataType: 'jsonp',
async: false,
error: function (jqXHR, textStatus, errorThrown) {
ok(textStatus, "Error Message = " + errorThrown);
start();
}
});
});