From aa44e253f47089e249612c496df85798922ac546 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Thu, 7 Jan 2010 19:42:51 +0000 Subject: cleanup patch for merge to trunk git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/account@896982 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/couch_test_runner.js | 7 +++++-- share/www/script/jquery.couch.js | 1 - share/www/script/test/oauth.js | 2 -- share/www/script/test/users_db.js | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) (limited to 'share/www') diff --git a/share/www/script/couch_test_runner.js b/share/www/script/couch_test_runner.js index ed67d744..237f9312 100644 --- a/share/www/script/couch_test_runner.js +++ b/share/www/script/couch_test_runner.js @@ -164,10 +164,13 @@ function setupAdminParty(fun) { }, "admins"); } }); - } else { - // not a logged in admin. + } else if (userCtx.roles.indexOf("_admin") != -1) { + // admin party! readyToRun = true; fun(); + } else { + // not an admin + alert("Error: You need to be an admin to run the tests."); }; } }); diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js index 8328af60..7e8a0236 100644 --- a/share/www/script/jquery.couch.js +++ b/share/www/script/jquery.couch.js @@ -136,7 +136,6 @@ }, logout: function(options) { options = options || {}; - // TODO this should also login as the logged-out guy using basic auth $.ajax({ type: "DELETE", url: "/_session", dataType: "json", username : "_", password : "_", diff --git a/share/www/script/test/oauth.js b/share/www/script/test/oauth.js index 89e0aaf8..d55d13e8 100644 --- a/share/www/script/test/oauth.js +++ b/share/www/script/test/oauth.js @@ -114,8 +114,6 @@ couchTests.oauth = function(debug) { usersDb.deleteDb(); usersDb.createDb(); - // Create a user - // T(CouchDB.createUser("jason", "testpassword", "test@somemail.com", ['test'], adminBasicAuthHeaderValue()).ok); // Create a user var jasonUserDoc = CouchDB.prepareUserDoc({ username: "jason", diff --git a/share/www/script/test/users_db.js b/share/www/script/test/users_db.js index 9e8024f6..2cf63fcf 100644 --- a/share/www/script/test/users_db.js +++ b/share/www/script/test/users_db.js @@ -43,6 +43,7 @@ couchTests.users_db = function(debug) { } }); T(s.name == "jchris@apache.org"); + T(s.user_doc._id == "org.couchdb.user:jchris@apache.org") T(s.info.authenticated == "{couch_httpd_auth, default_authentication_handler}"); T(s.info.user_db == "test_suite_users"); TEquals(["{couch_httpd_oauth, oauth_authentication_handler}", -- cgit v1.2.3