summaryrefslogtreecommitdiff
path: root/share/www
diff options
context:
space:
mode:
authorBenoit Chesneau <benoitc@apache.org>2010-08-21 13:09:50 +0000
committerBenoit Chesneau <benoitc@apache.org>2010-08-21 13:09:50 +0000
commit9b3c2688feba69fe178b4d1e9ecff5c1a36c9475 (patch)
tree82e56688444727cfdfa0ce42f1a6a8c79f6a470f /share/www
parent544bf49c09760e46507f71979f910f1ae81e2935 (diff)
add a test to check if rewrite works on views following a report on irc
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@987750 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www')
-rw-r--r--share/www/script/test/rewrite.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/share/www/script/test/rewrite.js b/share/www/script/test/rewrite.js
index 56d0c31b..86905f8f 100644
--- a/share/www/script/test/rewrite.js
+++ b/share/www/script/test/rewrite.js
@@ -98,6 +98,10 @@ couchTests.rewrite = function(debug) {
}
},
{
+ "from": "basicView",
+ "to": "_view/basicView",
+ },
+ {
"from": "simpleForm/basicView",
"to": "_list/simpleForm/basicView",
},
@@ -158,6 +162,10 @@ couchTests.rewrite = function(debug) {
"query": {
"key": [":a", ":b"]
}
+ },
+ {
+ "from": "/",
+ "to": "_view/basicView",
}
],
lists: {
@@ -311,7 +319,15 @@ couchTests.rewrite = function(debug) {
req = CouchDB.request("GET", "/test_suite_db/_design/test/_rewrite/welcome5/welcome3");
T(req.responseText == "Welcome welcome3");
-
+
+ xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_rewrite/basicView");
+ T(xhr.status == 200, "view call");
+ T(/{"total_rows":9/.test(xhr.responseText));
+
+ xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_rewrite/");
+ T(xhr.status == 200, "view call");
+ T(/{"total_rows":9/.test(xhr.responseText));
+
// get with query params
xhr = CouchDB.request("GET", "/test_suite_db/_design/test/_rewrite/simpleForm/basicView?startkey=3&endkey=8");