diff options
Diffstat (limited to 'test/javascript')
-rwxr-xr-x | test/javascript/run | 4 | ||||
-rw-r--r-- | test/javascript/tests/rewrite_js.js | 16 |
2 files changed, 14 insertions, 6 deletions
diff --git a/test/javascript/run b/test/javascript/run index a3b3ab704..ec12431b0 100755 --- a/test/javascript/run +++ b/test/javascript/run @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of @@ -146,7 +146,7 @@ def main(): sys.stderr.write("=======================================================" + os.linesep) sys.stderr.write("JavaScript tests complete." + os.linesep) - sys.stderr.write(" Failed: {}. Skipped or passed: {}.".format( + sys.stderr.write(" Failed: {0}. Skipped or passed: {1}.".format( failed, passed) + os.linesep) exit(failed > 0) diff --git a/test/javascript/tests/rewrite_js.js b/test/javascript/tests/rewrite_js.js index 9893127af..22de6c940 100644 --- a/test/javascript/tests/rewrite_js.js +++ b/test/javascript/tests/rewrite_js.js @@ -100,9 +100,12 @@ couchTests.rewrite = function(debug) { return {path: '_list/simpleForm/complexView2', query: {key: JSON.stringify({"c": 1})}}; } - if (req.path.slice(4).join('/') === 'simpleForm/complexView4') { - return {path: '_list/simpleForm/complexView2', - query: {key: JSON.stringify({"c": 1})}}; + if (req.path.slice(4).join('/') === 'simpleForm/sendBody1') { + return {path: '_list/simpleForm/complexView2', + method: 'POST', + query: {limit: '1'}, + headers:{'Content-type':'application/json'}, + body: JSON.stringify( {keys: [{"c": 1}]} )}; } if (req.path.slice(4).join('/') === '/') { return {path: '_view/basicView'}; @@ -283,6 +286,11 @@ couchTests.rewrite = function(debug) { T(xhr.status == 200, "with query params"); T(/Value: doc 5/.test(xhr.responseText)); + // COUCHDB-1612 - send body rewriting get to post + xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/simpleForm/sendBody1"); + T(xhr.status == 200, "get->post rewrite failed:\n"+xhr.responseText); + T(/Value: doc 5 LineNo: 1/.test(xhr.responseText), "get->post rewrite responded wrong:\n"+xhr.responseText); + // COUCHDB-2031 - path normalization versus qs params xhr = CouchDB.request("GET", "/"+dbName+"/_design/test/_rewrite/db/_design/test?meta=true"); T(xhr.status == 200, "path normalization works with qs params"); @@ -340,4 +348,4 @@ couchTests.rewrite = function(debug) { // cleanup db.deleteDb(); } -} +}
\ No newline at end of file |