null+****@clear*****
null+****@clear*****
2012年 6月 21日 (木) 14:40:16 JST
SHIMODA Hiroshi 2012-06-21 14:40:16 +0900 (Thu, 21 Jun 2012) New Revision: 727deb32251fd4b49c5849d71a25c648b7739ddf https://github.com/groonga/gcs/commit/727deb32251fd4b49c5849d71a25c648b7739ddf Log: Give domain name via Host header Modified files: test/api-batch.test.js Modified: test/api-batch.test.js (+15 -10) =================================================================== --- test/api-batch.test.js 2012-06-21 13:24:01 +0900 (ea67fe8) +++ test/api-batch.test.js 2012-06-21 14:40:16 +0900 (1e56898) @@ -33,10 +33,11 @@ suite('documents/batch API', function() { test('add', function(done) { var batch = fs.readFileSync(__dirname + '/fixture/companies/add.sdf.json', 'UTF-8'); - var path = '/2011-02-01/documents/batch?DomainName=companies'; + var path = '/2011-02-01/documents/batch'; utils.post(path, batch, { 'Content-Type': 'application/json', - 'Content-Length': batch.length + 'Content-Length': batch.length, + 'Host': 'doc-companies-example.localhost' }) .next(function(response) { var expected = { @@ -62,9 +63,10 @@ suite('documents/batch API', function() { }); test('no content type', function(done) { - var path = '/2011-02-01/documents/batch?DomainName=companies'; + var path = '/2011-02-01/documents/batch'; utils.post(path, 'foobar', { - 'Content-Length': 'foobar'.length + 'Content-Length': 'foobar'.length, + 'Host': 'doc-companies-example.localhost' }) .next(function(response) { var expected = { @@ -87,10 +89,11 @@ suite('documents/batch API', function() { }); test('invalid content type', function(done) { - var path = '/2011-02-01/documents/batch?DomainName=companies'; + var path = '/2011-02-01/documents/batch'; utils.post(path, 'foobar', { 'Content-Type': 'text/plain', - 'Content-Length': 'foobar'.length + 'Content-Length': 'foobar'.length, + 'Host': 'doc-companies-example.localhost' }) .next(function(response) { var expected = { @@ -113,9 +116,10 @@ suite('documents/batch API', function() { }); test('no content length', function(done) { - var path = '/2011-02-01/documents/batch?DomainName=companies'; + var path = '/2011-02-01/documents/batch'; utils.post(path, '[]', { - 'Content-Type': 'application/json' + 'Content-Type': 'application/json', + 'Host': 'doc-companies-example.localhost' }) .next(function(response) { var expected = { @@ -139,10 +143,11 @@ suite('documents/batch API', function() { test('invalid batches', function(done) { var batch = fs.readFileSync(__dirname + '/fixture/companies/invalid.sdf.json', 'UTF-8'); - var path = '/2011-02-01/documents/batch?DomainName=companies'; + var path = '/2011-02-01/documents/batch'; utils.post(path, batch, { 'Content-Type': 'application/json', - 'Content-Length': batch.length + 'Content-Length': batch.length, + 'Host': 'doc-companies-example.localhost' }) .next(function(response) { var expected = { -------------- next part -------------- HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...Download