aboutsummaryrefslogtreecommitdiffstats
path: root/test/support
diff options
context:
space:
mode:
authorJames Lal <james@lightsofapollo.com>2012-06-26 07:21:43 +0200
committerJames Lal <james@lightsofapollo.com>2012-06-26 07:21:43 +0200
commit646e0b6991c9e85de9b8eee20e601079fb128429 (patch)
treecdd2a21d7816936556eab9f99dd32e8914c2a426 /test/support
parent96683161e43fc0101c74f0875d1a2d445afe7e8d (diff)
downloadjsCalDAV-646e0b6991c9e85de9b8eee20e601079fb128429.tar.gz
abstract request
Diffstat (limited to 'test/support')
-rw-r--r--test/support/fake_xhr.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/support/fake_xhr.js b/test/support/fake_xhr.js
index 27e621b..6c4976d 100644
--- a/test/support/fake_xhr.js
+++ b/test/support/fake_xhr.js
@@ -5,8 +5,12 @@
this.sendArgs = null;
this.headers = {};
this.responseHeaders = {};
+
+ FakeXhr.instances.push(this);
}
+ FakeXhr.instances = [];
+
FakeXhr.prototype = {
open: function() {
this.openArgs = arguments;
@@ -26,8 +30,8 @@
respond: function(data, code) {
this.readyState = 4;
- this.responseHeaders['content-type'] = 'application/json';
- this.responseText = JSON.stringify(data);
+ this.responseHeaders['content-type'] = 'text/xml';
+ this.responseText = data;
this.status = code || 200;
this.onreadystatechange();
}