2010-09-17 08:30:06 +08:00
|
|
|
beforeEach(function() {
|
|
|
|
|
|
|
|
if (typeof jQuery != 'undefined') {
|
|
|
|
spyOn(jQuery.ajaxSettings, 'xhr').andCallFake(function() {
|
|
|
|
var newXhr = new FakeXMLHttpRequest();
|
|
|
|
ajaxRequests.push(newXhr);
|
|
|
|
return newXhr;
|
|
|
|
});
|
2010-09-18 01:10:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (typeof Prototype != 'undefined') {
|
2010-09-17 08:30:06 +08:00
|
|
|
spyOn(Ajax, "getTransport").andCallFake(function() {
|
|
|
|
return new FakeXMLHttpRequest();
|
|
|
|
});
|
|
|
|
}
|
2010-09-18 01:10:34 +08:00
|
|
|
|
2010-09-17 08:30:06 +08:00
|
|
|
clearAjaxRequests();
|
|
|
|
|
|
|
|
});
|