|
|
|
@ -151,11 +151,7 @@ jasmine.Ajax = {
|
|
|
|
|
installJquery: function() {
|
|
|
|
|
jasmine.Ajax.mode = 'jQuery';
|
|
|
|
|
jasmine.Ajax.real = jQuery.ajaxSettings.xhr;
|
|
|
|
|
jQuery.ajaxSettings.xhr = function() {
|
|
|
|
|
var newXhr = new FakeXMLHttpRequest();
|
|
|
|
|
ajaxRequests.push(newXhr);
|
|
|
|
|
return newXhr;
|
|
|
|
|
}
|
|
|
|
|
jQuery.ajaxSettings.xhr = jasmine.Ajax.jQueryMock;
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -163,9 +159,7 @@ jasmine.Ajax = {
|
|
|
|
|
jasmine.Ajax.mode = 'Prototype';
|
|
|
|
|
jasmine.Ajax.real = Ajax.getTransport;
|
|
|
|
|
|
|
|
|
|
Ajax.getTransport = function() {
|
|
|
|
|
return new FakeXMLHttpRequest();
|
|
|
|
|
};
|
|
|
|
|
Ajax.getTransport = jasmine.Ajax.prototypeMock;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
uninstallMock: function() {
|
|
|
|
@ -184,6 +178,16 @@ jasmine.Ajax = {
|
|
|
|
|
jasmine.Ajax.real = null;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
jQueryMock: function() {
|
|
|
|
|
var newXhr = new FakeXMLHttpRequest();
|
|
|
|
|
ajaxRequests.push(newXhr);
|
|
|
|
|
return newXhr;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
prototypeMock: function() {
|
|
|
|
|
return new FakeXMLHttpRequest();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
installed: false,
|
|
|
|
|
mode: null
|
|
|
|
|
}
|
|
|
|
|