diff options
author | Jan Lehnardt <jan@apache.org> | 2009-08-17 23:04:28 +0000 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2009-08-17 23:04:28 +0000 |
commit | f723cb99008f2462abec46ab9b614fb8dd2f31d1 (patch) | |
tree | 86d34e7c0283b4548b29daf88113700b61f569e7 /share/www/script | |
parent | 8cd75f5e84f7ec182ab5f4e91c3bc4cc5c3a95f6 (diff) |
allow list function and view function to be in different design docs, patch by Mark Hammond, closes COUCHDB-446
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@805201 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script')
-rw-r--r-- | share/www/script/test/list_views.js | 20 |
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)); }; |