jasmine-ajax/spec/javascripts/helpers/spec-helper.js
Davis W. Frank, dwfrank & Hunter Gillane 83ef1be6e9 Mock Ajax refactor & simplification
2010-09-16 17:07:01 -07:00

16 lines
333 B
JavaScript

jQuery.noConflict();
beforeEach(function() {
clearAjaxRequests();
spyOn(Ajax, "getTransport").andCallFake(function() {
return new FakeXMLHttpRequest();
});
spyOn(jQuery.ajaxSettings, 'xhr').andCallFake(function() {
var newXhr = new FakeXMLHttpRequest();
ajaxRequests.push(newXhr);
return newXhr;
});
});