couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beno...@apache.org
Subject svn commit: r987750 - /couchdb/trunk/share/www/script/test/rewrite.js
Date Sat, 21 Aug 2010 13:09:51 GMT
Author: benoitc
Date: Sat Aug 21 13:09:50 2010
New Revision: 987750

URL: http://svn.apache.org/viewvc?rev=987750&view=rev
Log:
add a test to check if rewrite works on views following a report on irc

Modified:
    couchdb/trunk/share/www/script/test/rewrite.js

Modified: couchdb/trunk/share/www/script/test/rewrite.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/rewrite.js?rev=987750&r1=987749&r2=987750&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/rewrite.js (original)
+++ couchdb/trunk/share/www/script/test/rewrite.js Sat Aug 21 13:09:50 2010
@@ -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");



Mime
View raw message