diff options
author | Azul <azul@leap.se> | 2012-07-20 10:56:36 +0200 |
---|---|---|
committer | Azul <azul@leap.se> | 2012-07-20 10:56:36 +0200 |
commit | 50de80c5e817476ac95a096c718a66f5555fcd05 (patch) | |
tree | e05a25868a999557e2788a91f41da3a5a8a1a0b0 /javascript/spec/specHelper.js | |
parent | 07fe2d8976db0ec267bd57ded90778f0d7695478 (diff) |
INCOMPATIBLE: major restructuring of the repository
* removed Django code - we're keeping the tests - so I hope the two can still be used together
* removed js packer - everyone has their own packaging strategy these days
* cleaned up the repository - we only have js so javascript directory does not make much sense
Diffstat (limited to 'javascript/spec/specHelper.js')
-rw-r--r-- | javascript/spec/specHelper.js | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/javascript/spec/specHelper.js b/javascript/spec/specHelper.js deleted file mode 100644 index 21a0cb7..0000000 --- a/javascript/spec/specHelper.js +++ /dev/null @@ -1,40 +0,0 @@ -var specHelper = (function() { - // HELPERS - - function setupFakeXHR() { - this.xhr = sinon.useFakeXMLHttpRequest(); - var requests = this.requests = []; - this.xhr.onCreate = function (xhr) { - requests.push(xhr); - }; - this.expectRequest = expectRequest; - this.respondJSON = respondJSON; - this.respondXML = respondXML; - } - - function expectRequest(url, content) { - expect(this.requests.length).toBe(1); - expect(this.requests[0].url).toBe(url); - expect(this.requests[0].requestBody).toBe(content); - } - - function respondXML(content) { - var request = this.requests.pop(); - header = { "Content-Type": "application/xml;charset=utf-8" }; - body = '<?xml version="1.0" encoding="UTF-8"?>\n'; - body += content; - request.respond(200, header, body); - } - - function respondJSON(object) { - var request = this.requests.pop(); - header = { "Content-Type": "application/json;charset=utf-8" }; - body = JSON.stringify(object); - request.respond(200, header, body); - } - - return { - setupFakeXHR: setupFakeXHR, - } - -})(); |