This is an automated email from the ASF dual-hosted git repository.

jan pushed a commit to branch rebase/access-2023
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 2f055d5047648a46239db19750f13f73f3961672
Author: Jan Lehnardt <[email protected]>
AuthorDate: Sat Aug 6 16:55:30 2022 +0200

    test(access): test disable access config
---
 src/couch/test/eunit/couchdb_access_tests.erl | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/couch/test/eunit/couchdb_access_tests.erl 
b/src/couch/test/eunit/couchdb_access_tests.erl
index 1b656499c..33fb576ff 100644
--- a/src/couch/test/eunit/couchdb_access_tests.erl
+++ b/src/couch/test/eunit/couchdb_access_tests.erl
@@ -73,6 +73,10 @@ after_all(_) ->
 
 access_test_() ->
     Tests = [
+
+        % Server config
+        fun should_not_let_create_access_db_if_disabled/2,
+
         % Doc creation
         fun should_not_let_anonymous_user_create_doc/2,
         fun should_let_admin_create_doc_with_access/2,
@@ -167,6 +171,12 @@ make_test_cases(Mod, Funs) ->
 %   end).
 %
 
+should_not_let_create_access_db_if_disabled(_PortType, Url) ->
+    ok = config:set("per_doc_access", "enabled", "false", _Persist=false),
+    {ok, Code, _, _} = test_request:put(url() ++ "/db?q=1&n=1&access=true", 
?ADMIN_REQ_HEADERS, ""),
+    ok = config:set("per_doc_access", "enabled", "true", _Persist=false),
+    ?_assertEqual(400, Code).
+
 should_not_let_anonymous_user_create_doc(_PortType, Url) ->
     % TODO: debugging leftover
     % BulkDocsBody = {[

Reply via email to