aboutsummaryrefslogtreecommitdiffstats
path: root/test/support/fake_xhr.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/support/fake_xhr.js')
-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();
}