couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [01/26] couchdb commit: updated refs/heads/auth-tests-wip to f951e9f
Date Fri, 10 Jun 2016 10:08:24 GMT
Repository: couchdb
Updated Branches:
  refs/heads/auth-tests-wip 300898b0c -> f951e9fd8


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/59890730
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/59890730
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/59890730

Branch: refs/heads/auth-tests-wip
Commit: 598907302899727be2d986a61aaf2e585a3736c9
Parents: 300898b
Author: sebastianro <sebastianro@apache.org>
Authored: Tue May 17 20:03:30 2016 +0200
Committer: sebastianro <sebastianro@apache.org>
Committed: Tue May 17 20:03:30 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/59890730/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