Created
November 14, 2014 04:17
-
-
Save ama-ch/d0c676b168a7254c4368 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/main/webapp/static/js/kintone/proxy/proxy_spec.js b/src/main/webapp/static/js/kintone/proxy/proxy_spec.js | |
index 64d416a..9840fc4 100644 | |
--- a/src/main/webapp/static/js/kintone/proxy/proxy_spec.js | |
+++ b/src/main/webapp/static/js/kintone/proxy/proxy_spec.js | |
@@ -108,7 +108,15 @@ describe('kintone.proxy', function() { | |
cybozu.data['REQUEST_TOKEN'] = 'hoge'; | |
kintone.proxy('url', 'POST', {}, {}, callback); | |
- server.requests[0].respond(200, {}, ''); | |
+ server.requests[0].respond(200, {}, JSON.stringify({ | |
+ 'success': true, | |
+ 'result': { | |
+ 'body': null, | |
+ 'headers': {'Content-Type': 'application/json'}, | |
+ 'status': 200 | |
+ } | |
+ | |
+ })); | |
var bodyObj = JSON.parse(server.requests[0].requestBody); | |
expect(bodyObj['__REQUEST_TOKEN__']).to.be('hoge'); | |
@@ -116,7 +124,14 @@ describe('kintone.proxy', function() { | |
it('必要なヘッダががリクエストにのる', function() { | |
kintone.proxy('url', 'POST', {}, {}, callback); | |
- server.requests[0].respond(200, {}, ''); | |
+ server.requests[0].respond(200, {}, JSON.stringify({ | |
+ 'success': true, | |
+ 'result': { | |
+ 'body': null, | |
+ 'headers': {'Content-Type': 'application/json'}, | |
+ 'status': 200 | |
+ } | |
+ })); | |
var headers = server.requests[0].requestHeaders; | |
expect(headers['X-Requested-With']).to.be('XMLHttpRequest'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment