summaryrefslogtreecommitdiff
path: root/share/www/script/test/oauth.js
diff options
context:
space:
mode:
Diffstat (limited to 'share/www/script/test/oauth.js')
-rw-r--r--share/www/script/test/oauth.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/share/www/script/test/oauth.js b/share/www/script/test/oauth.js
index 55f2f430..62782853 100644
--- a/share/www/script/test/oauth.js
+++ b/share/www/script/test/oauth.js
@@ -94,8 +94,17 @@ couchTests.oauth = function(debug) {
headers: {"X-Couch-Persist": "false"},
body: JSON.stringify(testadminPassword)
});
-
- CouchDB.request("GET", "/_sleep?time=50");
+ while (true) {
+ //loop until the couch server has processed the password
+ var xhr = CouchDB.request("GET", "http://" + host + "/_config/admins/testadmin?foo="+i,{
+ headers: {
+ "Authorization": adminBasicAuthHeaderValue()
+ }})
+ if (xhr.responseText.indexOf("\"-hashed-") == 0) {
+ break;
+ }
+ console.log("foo:" + xhr.responseText)
+ }
CouchDB.newUuids(2); // so we have one to make the salt