diff options
author | Benoit Chesneau <benoitc@apache.org> | 2010-08-18 18:54:40 +0000 |
---|---|---|
committer | Benoit Chesneau <benoitc@apache.org> | 2010-08-18 18:54:40 +0000 |
commit | 1f729f7f261f9607b74b6c8723e190720db8dc32 (patch) | |
tree | 5748a7900e02b409811b9804d4e7fa1fc5a75c44 /share/www/script/test/show_documents.js | |
parent | 4b0f69f2fa9a8a6ead5ad62c1ebacfc50ede4591 (diff) |
expose security obj to shows, lists & updates functions.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@986854 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 | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/share/www/script/test/show_documents.js b/share/www/script/test/show_documents.js index e06bcadc..55ed9698 100644 --- a/share/www/script/test/show_documents.js +++ b/share/www/script/test/show_documents.js @@ -157,6 +157,9 @@ couchTests.show_documents = function(debug) { }), "withSlash": stringFun(function(doc, req) { return { json: doc } + }), + "secObj": stringFun(function(doc, req) { + return { json: req.secObj }; }) } }; @@ -410,5 +413,24 @@ couchTests.show_documents = function(debug) { db.deleteDoc(doc); var xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/show-deleted/testdoc"); TEquals("No doc testdoc", xhr.responseText, "should return 'no doc testdoc'"); + + + run_on_modified_server( + [{section: "httpd", + key: "authentication_handlers", + value: "{couch_httpd_auth, special_test_authentication_handler}"}, + {section:"httpd", + key: "WWW-Authenticate", + value: "X-Couch-Test-Auth"}], + + function() { + T(db.setDbProperty("_security", {foo: true}).ok); + T(db.save(doc).ok); + + xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/secObj"); + var resp = JSON.parse(xhr.responseText); + T(resp.foo == true); + } + ); }; |