From d054aef0e2419db31d8277a051b54abdf6ee1d34 Mon Sep 17 00:00:00 2001 From: Christopher Lenz Date: Mon, 23 Jun 2008 21:32:58 +0000 Subject: Apply patch by Chris Anderson that fixes an edge case in the HTTP view interface resulting in an invalid JSON response body. Closes COUCHDB-84. git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@670774 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/couch_tests.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js index c8884252..3863a380 100644 --- a/share/www/script/couch_tests.js +++ b/share/www/script/couch_tests.js @@ -328,7 +328,12 @@ var tests = { T(equals(results.rows[1], {key:["a","b"],value:20*i})); T(equals(results.rows[2], {key:["a", "b", "c"],value:10*i})); T(equals(results.rows[3], {key:["a", "b", "d"],value:10*i})); - + + // test to make sure group reduce and count params provide valid json + var results = db.query(map, reduce, {group: true, count: 2}); + T(equals(results.rows[0], {key: ["a"], value: 20*i})); + T(equals(results.rows.length, 2)); + //group by the first element in the key array var results = db.query(map, reduce, {group_level:1}); T(equals(results.rows[0], {key:["a"],value:70*i})); @@ -1146,7 +1151,7 @@ var tests = { db.deleteDb(); db.createDb(); if (debug) debugger; - var docs = makeDocs(0, 25); + var docs = makeDocs(0, 10); var saveResult = db.bulkSave(docs); T(saveResult.ok); -- cgit v1.2.3