summaryrefslogtreecommitdiff
path: root/test/support/integration_test.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-03-17 15:03:33 -0700
committerelijah <elijah@riseup.net>2015-03-17 15:03:33 -0700
commit0d00d6a8f6eaf15d2a3e5125e599f9735c85d5d6 (patch)
tree44046ba1108870d7b5ffbb75ba01eef6cf8866ee /test/support/integration_test.rb
parent413b42ea36b5e0406187a881183f4648d8534ec5 (diff)
added support for tmp_users db. not backward compatible with prior config files (seq_file changed to seq_dir)
Diffstat (limited to 'test/support/integration_test.rb')
-rw-r--r--test/support/integration_test.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/support/integration_test.rb b/test/support/integration_test.rb
index 552b0a1..86553c2 100644
--- a/test/support/integration_test.rb
+++ b/test/support/integration_test.rb
@@ -5,16 +5,16 @@ module Tapicero
# create a dummy record for the user
# so that tapicero will get a new user event
#
- def create_user(fast = false)
- result = database.save_doc :some => :content
+ def create_user(fast = false, db_name = 'users')
+ result = database(db_name).save_doc :some => :content
raise RuntimeError.new(result.inspect) unless result['ok']
sleep 1 unless fast # allow tapicero to do its job
@user = {'_id' => result["id"], '_rev' => result["rev"]}
end
- def delete_user(fast = false)
+ def delete_user(fast = false, db_name = 'users')
return if @user.nil? or @user['_deleted']
- result = database.delete_doc @user
+ result = database(db_name).delete_doc @user
raise RuntimeError.new(result.inspect) unless result['ok']
@user['_deleted'] = true
sleep 1 unless fast # allow tapicero to do its job
@@ -26,12 +26,12 @@ module Tapicero
puts 'failed to find per user db'
end
- def database
- @database ||= host.database!(database_name)
+ def database(db_name='users')
+ @database ||= host.database!(database_name_with_prefix(db_name))
end
- def database_name
- config.complete_db_name('users')
+ def database_name_with_prefix(db_name)
+ config.complete_db_name(db_name)
end
def host