From 0d00d6a8f6eaf15d2a3e5125e599f9735c85d5d6 Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 17 Mar 2015 15:03:33 -0700 Subject: added support for tmp_users db. not backward compatible with prior config files (seq_file changed to seq_dir) --- test/support/integration_test.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'test/support/integration_test.rb') 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 -- cgit v1.2.3