Blame view

framework/thirdparty/jasmine-ajax/lib/spec-helper.js 428 Bytes
385d70ca   Administrator   Importers CRUD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  beforeEach(function() {
  
    if (typeof jQuery != 'undefined') {
      spyOn(jQuery.ajaxSettings, 'xhr', true).andCallFake(function() {
        var newXhr = new FakeXMLHttpRequest();
        ajaxRequests.push(newXhr);
        return newXhr;
      });
    }
  
    if (typeof Prototype != 'undefined') {
      spyOn(Ajax, "getTransport", true).andCallFake(function() {
        return new FakeXMLHttpRequest();
      });
    }
  
    clearAjaxRequests();
  
  });