Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed old mock for jquery

  • Loading branch information...
commit aeb873d48059f39d3bd3224acbc3b16bfa80565a 1 parent 6f8fd0d
@hgillane hgillane authored
Showing with 0 additions and 69 deletions.
  1. +0 −69 examples/jquery/spec/javascripts/helpers/jquery-mock-ajax.js
View
69 examples/jquery/spec/javascripts/helpers/jquery-mock-ajax.js
@@ -1,69 +0,0 @@
-//function decodeParams(string) {
-// var keyValuePairs = string.replace(/\+/g, "%20").split("&");
-// var hash = {};
-// $(keyValuePairs).each(function () {
-// var equalSplit = this.split("=");
-// var key = decodeURIComponent(equalSplit[0]);
-// if (hash[key] == null) {
-// hash[key] = decodeURIComponent(equalSplit[1]);
-// } else if (jQuery.isArray(hash[key])) {
-// hash[key].push(decodeURIComponent(equalSplit[1]));
-// } else {
-// hash[key] = [hash[key]];
-// hash[key].push(decodeURIComponent(equalSplit[1]));
-// }
-// });
-// return hash;
-//}
-
-// function replaceNextXhr(xhrHash) {
-// xhrSpy.andCallFake(function() {
-// var newXhr = stubXhr(xhrHash);
-// xhrs.push(newXhr);
-// return newXhr;
-// });
-// }
-
-function stubXhr(options) {
- var xhr = {
- requestHeaders: {},
- open: function() {
- xhr.method = arguments[0];
- xhr.url = arguments[1];
- },
-
- setRequestHeader: function(header, value) {
- xhr.requestHeaders[header] = value;
- },
-
- abort: function() {
- },
-
- readyState: 1,
-
- status: null,
-
- send: function(data) {
- xhr.params = data;
- },
-
- getResponseHeader: function() {},
-
- responseText: null,
-
- response: function(response) {
- xhr.status = response.status;
- xhr.responseText = response.responseText || "";
- xhr.readyState = 4;
-
- // uncomment for jquery 1.3.x support
- // jasmine.Clock.tick(20);
-
- xhr.onreadystatechange();
- }
- };
-
- jQuery.extend(xhr, options || {});
-
- return xhr;
-}
Please sign in to comment.
Something went wrong with that request. Please try again.