diff options
author | Azul <azul@riseup.net> | 2014-02-04 10:09:40 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2014-02-04 11:46:57 +0100 |
commit | 2836e9453618d9cc7dc64cb99651c4e5a40fb11c (patch) | |
tree | a1f6740c5e0b7c0679d45788465156a0e97ad71e /test/support/integration_test.rb | |
parent | 1765981c8c0c3f2eddfd326e83505910be97e01c (diff) |
separate test setup test from actual test
Diffstat (limited to 'test/support/integration_test.rb')
-rw-r--r-- | test/support/integration_test.rb | 30 |
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 |