diff options
author | elijah <elijah@riseup.net> | 2015-03-17 15:03:33 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2015-03-17 15:03:33 -0700 |
commit | 0d00d6a8f6eaf15d2a3e5125e599f9735c85d5d6 (patch) | |
tree | 44046ba1108870d7b5ffbb75ba01eef6cf8866ee /test/integration | |
parent | 413b42ea36b5e0406187a881183f4648d8534ec5 (diff) |
added support for tmp_users db. not backward compatible with prior config files (seq_file changed to seq_dir)
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/tmp_user_test.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/integration/tmp_user_test.rb b/test/integration/tmp_user_test.rb new file mode 100644 index 0000000..dff8f4e --- /dev/null +++ b/test/integration/tmp_user_test.rb @@ -0,0 +1,37 @@ +require_relative '../test_helper.rb' + +class TmpUserTest < Tapicero::IntegrationTest + + def setup + TapiceroProcess.run_with_config("test/config.yaml") + create_user(false, 'tmp_users') + sleep 0.1 + end + + def teardown + delete_user(true, 'tmp_users') + end + + def test_creates_user_db + assert_database_exists user_database + end + + def test_configures_security + assert_equal config.options[:security], user_database.get('_security') + end + + def test_stores_design_docs + assert_equal ['_design/docs', '_design/syncs', '_design/transactions'], + design_docs(user_database).map{|doc| doc["id"]}.sort + end + + def test_deletes_user_db + assert_database_exists user_database + delete_user(false, 'tmp_users') + assert !host.databases.include?(user_database.name), 'user db must not exist' + end + + def design_docs(db) + db.documents(startkey: '_design', endkey: '_design'.succ)["rows"] + end +end |