couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [45/50] couchdb commit: updated refs/heads/auth-tests-wip to c34d871
Date Tue, 12 Jul 2016 19:41:28 GMT
Stabilize cookie_auth


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/869cf544
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/869cf544
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/869cf544

Branch: refs/heads/auth-tests-wip
Commit: 869cf544a119426d94ff0c783415467618d3a591
Parents: 6411a40
Author: sebastianro <sebastianro@apache.org>
Authored: Tue May 17 20:03:30 2016 +0200
Committer: Jan Lehnardt <jan@apache.org>
Committed: Tue Jul 12 20:55:58 2016 +0200

----------------------------------------------------------------------
 test/javascript/tests/cookie_auth.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/869cf544/test/javascript/tests/cookie_auth.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/cookie_auth.js b/test/javascript/tests/cookie_auth.js
index 9a14416..5c8ce89 100644
--- a/test/javascript/tests/cookie_auth.js
+++ b/test/javascript/tests/cookie_auth.js
@@ -75,7 +75,7 @@ couchTests.cookie_auth = function(debug) {
 
       // test that the users db is born with the auth ddoc
       var ddoc = open_as(usersDb, "_design/_auth", "jan");
-      T(ddoc.validate_doc_update);
+      T(ddoc && ddoc.validate_doc_update);
 
       // TODO test that changing the config so an existing db becomes the users db installs
the ddoc also
 
@@ -277,10 +277,17 @@ couchTests.cookie_auth = function(debug) {
     TEquals(true, CouchDB.login("jan", "apple").ok);
   };
 
+  // per se, _users is born with a ddoc
+  // problem is: the birth seems async and it takes some time till it is there. We do know,
however, that it WILL. So: use _changes 2 our advantage
+  var users_db_chg = CouchDB.request("GET", users_db_name + "/_changes?feed=longpoll&timeout=5000&filter=_design");
+  T(users_db_chg.responseText);
+  // now we should be safe
   run_on_modified_server(
     [
      {section: "couch_httpd_auth",
       key: "authentication_db", value: users_db_name},
+     {section: "chttpd_auth",
+      key: "authentication_db", value: users_db_name},
      {section: "couch_httpd_auth",
       key: "iterations", value: "1"},
      {section: "admins",


Mime
View raw message