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.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/support/integration_test.rb b/test/support/integration_test.rb
new file mode 100644
index 0000000..58469b9
--- /dev/null
+++ b/test/support/integration_test.rb
@@ -0,0 +1,30 @@
+module Tapicero
+ class IntegrationTest < MiniTest::Unit::TestCase
+
+ def create_user
+ result = database.save_doc :some => :content
+ raise RuntimeError.new(result.inspect) unless result['ok']
+ @user_id = result['id']
+ end
+
+ def user_database
+ host.database(config.options[:db_prefix] + @user_id)
+ end
+
+ def database
+ @database ||= host.database(database_name)
+ end
+
+ def database_name
+ config.complete_db_name('users')
+ end
+
+ def host
+ @host ||= CouchRest.new(config.couch_host)
+ end
+
+ def config
+ Tapicero.config
+ end
+ end
+end