summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2014-07-14 21:40:54 +0200
committerAzul <azul@riseup.net>2014-07-14 21:40:54 +0200
commite97d0195fff2286d35c18866167b74cc37d58130 (patch)
tree7aaeab22e55622168d3ebf6c74fab30876904963
parent3206634d0d17064ecd4b18cc8e2e47051e422bf3 (diff)
fix couch tests to use admin credentials
-rw-r--r--tests/white-box/couchdb.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/white-box/couchdb.rb b/tests/white-box/couchdb.rb
index 74bd47bf..6d3a7452 100644
--- a/tests/white-box/couchdb.rb
+++ b/tests/white-box/couchdb.rb
@@ -71,7 +71,7 @@ class CouchDB < LeapTest
def test_04_Do_ACL_users_exist?
acl_users = ['_design/_auth', 'leap_mx', 'nickserver', 'soledad', 'tapicero', 'webapp', 'replication']
- url = couchdb_backend_url("/_users/_all_docs")
+ url = couchdb_backend_url("/_users/_all_docs", :user => 'admin')
assert_get(url) do |body|
response = JSON.parse(body)
assert_equal acl_users.count, response['total_rows']
@@ -84,7 +84,8 @@ class CouchDB < LeapTest
def test_05_Do_required_databases_exist?
dbs_that_should_exist = ["customers","identities","keycache","sessions","shared","tickets","tokens","users"]
dbs_that_should_exist.each do |db_name|
- assert_get(couchdb_url("/"+db_name)) do |body|
+ url = couchdb_url("/"+db_name, :user => 'admin')
+ assert_get(url) do |body|
assert response = JSON.parse(body)
assert_equal db_name, response['db_name']
end
@@ -129,9 +130,10 @@ class CouchDB < LeapTest
url
end
- def couchdb_backend_url(path="")
+ def couchdb_backend_url(path="", options={})
# TODO: admin port is hardcoded for now but should be configurable.
- couchdb_url(path, multimaster? && "5986")
+ options = {port: multimaster? && "5986"}.merge options
+ couchdb_url(path, options)
end
def multimaster?