summaryrefslogtreecommitdiff
path: root/test/support/integration_test.rb
diff options
context:
space:
mode:
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