From 9b3c2688feba69fe178b4d1e9ecff5c1a36c9475 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Sat, 21 Aug 2010 13:09:50 +0000 Subject: 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 --- share/www/script/test/rewrite.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'share') 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 @@ -97,6 +97,10 @@ couchTests.rewrite = function(debug) { "name": "*" } }, + { + "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"); -- cgit v1.2.3