summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsebastianro <sebastianro@apache.org>2016-05-17 20:03:30 +0200
committerJan Lehnardt <jan@apache.org>2016-07-12 20:55:58 +0200
commit869cf544a119426d94ff0c783415467618d3a591 (patch)
tree60419d0730f9cd36ce9e6bf2de1139e0119b7a05
parent6411a40494f0e8f59a8852c17a7d9692b2a19ad9 (diff)
downloadcouchdb-869cf544a119426d94ff0c783415467618d3a591.tar.gz
Stabilize cookie_auth
-rw-r--r--test/javascript/tests/cookie_auth.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/javascript/tests/cookie_auth.js b/test/javascript/tests/cookie_auth.js
index 9a1441662..5c8ce8968 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",