summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/www/script/test/list_views.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/share/www/script/test/list_views.js b/share/www/script/test/list_views.js
index a7f3eadb..e297f0a3 100644
--- a/share/www/script/test/list_views.js
+++ b/share/www/script/test/list_views.js
@@ -166,6 +166,17 @@ couchTests.list_views = function(debug) {
})
}
};
+ var viewOnlyDesignDoc = {
+ _id:"_design/views",
+ language: "javascript",
+ views : {
+ basicView : {
+ map : stringFun(function(doc) {
+ emit(-doc.integer, doc.string);
+ })
+ }
+ }
+ };
T(db.save(designDoc).ok);
@@ -359,4 +370,13 @@ couchTests.list_views = function(debug) {
T(xhr.getResponseHeader("Content-Type") == "application/xml");
T(xhr.responseText.match(/XML/));
T(xhr.responseText.match(/entry/));
+
+ // Test we can run lists and views from separate docs.
+ T(db.save(viewOnlyDesignDoc).ok);
+ xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/simpleForm/views/basicView?startkey=-3");
+ T(xhr.status == 200, "with query params");
+ T(/Total Rows/.test(xhr.responseText));
+ T(!(/Key: -4/.test(xhr.responseText)));
+ T(/FirstKey: -3/.test(xhr.responseText));
+ T(/LastKey: 0/.test(xhr.responseText));
};