From e8ca9805f1ea6fb13cb7255ea90b127ac3b8201f Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Thu, 5 Mar 2009 19:47:25 +0000 Subject: allow multi-key POST requests for _list. closes COUCHDB-269. thanks Jason Davies git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@750565 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/list_views.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'share/www') diff --git a/share/www/script/test/list_views.js b/share/www/script/test/list_views.js index 5469efd2..6ebd159e 100644 --- a/share/www/script/test/list_views.js +++ b/share/www/script/test/list_views.js @@ -257,4 +257,23 @@ couchTests.list_views = function(debug) { xhr = CouchDB.request("GET", "/test_suite_db/_list/lists/emptyList/withReduce?group=true"); T(xhr.responseText.match(/^$/)); + // multi-key fetch + var xhr = CouchDB.request("POST", "/test_suite_db/_list/lists/simpleForm/basicView", { + body: '{"keys":[2,4,5,7]}' + }); + T(xhr.status == 200); + T(/Total Rows/.test(xhr.responseText)); + T(!(/Key: 1/.test(xhr.responseText))); + T(/Key: 2/.test(xhr.responseText)); + T(/FirstKey: 2/.test(xhr.responseText)); + T(/LastKey: 7/.test(xhr.responseText)); + xhr = CouchDB.request("POST", "/test_suite_db/_list/lists/simpleForm/withReduce?group=true", { + body: '{"keys":[2,4,5,7]}' + }); + T(xhr.status == 200); + T(/Total Rows/.test(xhr.responseText)); + T(!(/Key: 1/.test(xhr.responseText))); + T(/Key: 2/.test(xhr.responseText)); + T(/FirstKey: 2/.test(xhr.responseText)); + T(/LastKey: 7/.test(xhr.responseText)); }; -- cgit v1.2.3