summaryrefslogtreecommitdiff
path: root/test/integration/tmp_user_test.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-03-17 15:06:54 -0700
committerelijah <elijah@riseup.net>2015-03-17 15:06:54 -0700
commit74a8f39a0d91f7f992c41cced01f80f24001e173 (patch)
tree2c459d89ed9d1e284098dc43715db813eab97f27 /test/integration/tmp_user_test.rb
parent2d42b4a39eaa346b94fa4aa2bb90bebb5621112e (diff)
parent25b34acce7612f58c5d40819de79734b08cdfb8f (diff)
Merge branch 'develop' into version/0.6.1version/0.6.1
Conflicts: Gemfile.lock
Diffstat (limited to 'test/integration/tmp_user_test.rb')
-rw-r--r--test/integration/tmp_user_test.rb37
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