Would it be possible to add a more complex async test... perhaps one that actually spoofs the server and does a full ajax request? Just for test completeness sake:
define(function(require) {
var bunit = require("external/bunit/bunit");
var assert = require("external/bunit/assert");
var $ = require("jquery");
bunit("Request manager", {
tearDown: function() {
$(".btn").click();
},
asyncTest: function(o, done) {
var server = sinon.sandbox.useFakeServer();
server.respondWith("GET", "/test/1", [
200, { "Content-Type": "application/json" },
'{"response": "some_response"}'
]);
// call stop(); now if you want, since we named our test using async prefix,
// that won't be needed
$.ajax({
type: "GET",
url: "/test/1",
success: function(data) {
assert(data.response).equals("some_response");
done();
}
});
server.respond();
}
});
});
Would it be possible to add a more complex async test... perhaps one that actually spoofs the server and does a full ajax request? Just for test completeness sake: