diff options
Diffstat (limited to 'helpers/FakeXMLHttpRequest.js')
-rw-r--r-- | helpers/FakeXMLHttpRequest.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/helpers/FakeXMLHttpRequest.js b/helpers/FakeXMLHttpRequest.js index a67d7f74..6dc35b98 100644 --- a/helpers/FakeXMLHttpRequest.js +++ b/helpers/FakeXMLHttpRequest.js @@ -6,6 +6,9 @@ var FakeXMLHttpRequest = function () { this.readyState = 4; this.onreadystatechange = null; this.async = false; + this.headers = { + 'Content-Type': 'text/plain' + }; }; FakeXMLHttpRequest.prototype.open = function (method, host, async) { @@ -15,6 +18,10 @@ FakeXMLHttpRequest.prototype.open = function (method, host, async) { this.async = async; }; +FakeXMLHttpRequest.prototype.setRequestHeader = function(name, value) { + this.headers[name] = value; +}; + FakeXMLHttpRequest.prototype.send = function (payload) { assert.equal(typeof payload, 'string'); if (this.async) { |