I want to test the following AJAX function
my.var = true;
my.method = function() {
$.getJSON('/path/to/',
function(data){
my.var = false;
});
}
How should I use JsTestDriver to test that my.var has changed?
AsyncTestCase("MyAsyncTestCase", {
$.mockjax({
url: '/path/to/'
});
my.method();
});
I’ve tried to use queue.call method unseccessfully
I found the following solution