diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-07-10 00:59:36 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-07-10 00:59:36 +0000 |
commit | 9ccb235a2d58d6b7caf406952f18ca13d9889f3e (patch) | |
tree | 9a0f6ac06d91d6bd70aee5d6f921665423139653 /share/www/script/test/show_documents.js | |
parent | 2f18f60fea5a1de6a221c6124038399c47d42aa2 (diff) |
Apply patch from Benoit Chesneau's COUCHDB-404
Restores 0.8-style /db/_view view urls and adds an option to render views and documents as other formats like:
/db/docid?show=blog/post
/db/_view/blog/posts?list=index
We're retaining the longer _design/appname paths as well because that resource is valuable for reverse proxies and rewriters.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@792771 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/test/show_documents.js')
-rw-r--r-- | share/www/script/test/show_documents.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/share/www/script/test/show_documents.js b/share/www/script/test/show_documents.js index 7201ae81..6f41f6e8 100644 --- a/share/www/script/test/show_documents.js +++ b/share/www/script/test/show_documents.js @@ -147,6 +147,14 @@ couchTests.show_documents = function(debug) { // Fix for COUCHDB-379 T(equals(xhr.getResponseHeader("Server").substr(0,7), "CouchDB")); + + + xhr = CouchDB.request("GET", "/test_suite_db/"+docid+"?show=template/hello"); + T(xhr.responseText == "Hello World"); + T(/charset=utf-8/.test(xhr.getResponseHeader("Content-Type"))) + + // Fix for COUCHDB-379 + T(equals(xhr.getResponseHeader("Server").substr(0,7), "CouchDB")); // // error stacktraces // xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/render-error/"+docid); @@ -163,7 +171,10 @@ couchTests.show_documents = function(debug) { // show with doc xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/"+docid); T(xhr.responseText == "Just Rusty"); - + + xhr = CouchDB.request("GET", "/test_suite_db/"+docid+"?show=template/just-name"); + T(xhr.responseText == "Just Rusty"); + // show with missing doc xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/just-name/missingdoc"); |