jasmine-ajax/spec/javascripts/helpers/spec-helper.js

16 lines
333 B
JavaScript
Raw Normal View History

jQuery.noConflict();
2010-09-17 05:24:35 +08:00
beforeEach(function() {
clearAjaxRequests();
spyOn(Ajax, "getTransport").andCallFake(function() {
2010-09-17 08:07:01 +08:00
return new FakeXMLHttpRequest();
});
spyOn(jQuery.ajaxSettings, 'xhr').andCallFake(function() {
2010-09-17 08:07:01 +08:00
var newXhr = new FakeXMLHttpRequest();
ajaxRequests.push(newXhr);
return newXhr;
});
2010-09-17 05:24:35 +08:00
});