Skip to content

Instantly share code, notes, and snippets.

@ama-ch
Created November 14, 2014 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ama-ch/d0c676b168a7254c4368 to your computer and use it in GitHub Desktop.
Save ama-ch/d0c676b168a7254c4368 to your computer and use it in GitHub Desktop.
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