summaryrefslogtreecommitdiff
path: root/share/www/script
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2010-11-14 23:16:17 +0000
committerJan Lehnardt <jan@apache.org>2010-11-14 23:16:17 +0000
commitfc87bb1f1aca6cde42a4904c0b59b089ab1c8f32 (patch)
treeef96409d3d737f08142656f9468b7fbff2ccec63 /share/www/script
parented4f41ae7377345cd0c5cd8421d2bbf77b88a94c (diff)
Allow reduce=false parameter in map-only views.
Patch by Jason Smith. Closes COUCHDB-881. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1035097 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script')
-rw-r--r--share/www/script/test/view_errors.js25
1 files changed, 22 insertions, 3 deletions
diff --git a/share/www/script/test/view_errors.js b/share/www/script/test/view_errors.js
index c6cbcc55..e8bd08e4 100644
--- a/share/www/script/test/view_errors.js
+++ b/share/www/script/test/view_errors.js
@@ -74,9 +74,6 @@ couchTests.view_errors = function(debug) {
T(e.error == "query_parse_error");
}
- // reduce=false on map views doesn't work, so group=true will
- // never throw for temp reduce views.
-
var designDoc = {
_id:"_design/test",
language: "javascript",
@@ -104,6 +101,15 @@ couchTests.view_errors = function(debug) {
db.view("test/no_reduce", {group: true});
T(0 == 1);
} catch(e) {
+ T(db.last_req.status == 400);
+ T(e.error == "query_parse_error");
+ }
+
+ try {
+ db.view("test/no_reduce", {group_level: 1});
+ T(0 == 1);
+ } catch(e) {
+ T(db.last_req.status == 400);
T(e.error == "query_parse_error");
}
@@ -115,10 +121,23 @@ couchTests.view_errors = function(debug) {
T(e.error == "query_parse_error");
}
+ db.view("test/no_reduce", {reduce: false});
+ TEquals(200, db.last_req.status, "reduce=false for map views (without"
+ + " group or group_level) is allowed");
+
try {
db.view("test/with_reduce", {group: true, reduce: false});
T(0 == 1);
} catch(e) {
+ T(db.last_req.status == 400);
+ T(e.error == "query_parse_error");
+ }
+
+ try {
+ db.view("test/with_reduce", {group_level: 1, reduce: false});
+ T(0 == 1);
+ } catch(e) {
+ T(db.last_req.status == 400);
T(e.error == "query_parse_error");
}