summaryrefslogtreecommitdiff
path: root/test/integration/actions_test.rb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2014-07-01 10:20:24 +0200
committerAzul <azul@riseup.net>2014-07-01 10:20:24 +0200
commitaac4577031728dab84f077b54e461fcb813ac0c3 (patch)
tree43766ce7212f3f47e4ed3d8e3979721a810167fb /test/integration/actions_test.rb
parent478cd9faf5fb78b2f9905ec098827d4c4188c19d (diff)
pid issue remains to be solved - revert to sth working
We've seen two instances of tapicero running on the production servers. The reason is that we are using two different places for the pid file - one for root and one for a normal user. In this scenario tapicero started by root will not notice the tapicero run as a normal user and vice versa. One idea was to solve this by always using /var/run/pid. However this also requires write privileges to that place which essentially only root has. So let's keep the two different places and just make sure we ALWAYS run tapicero as the same user.
Diffstat (limited to 'test/integration/actions_test.rb')
-rw-r--r--test/integration/actions_test.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/integration/actions_test.rb b/test/integration/actions_test.rb
new file mode 100644
index 0000000..88e3715
--- /dev/null
+++ b/test/integration/actions_test.rb
@@ -0,0 +1,37 @@
+require_relative '../test_helper.rb'
+
+class TapiceroTest < Tapicero::IntegrationTest
+
+ def setup
+ create_user
+ end
+
+ def teardown
+ delete_user(true)
+ end
+
+ def test_creates_user_db
+ assert user_database
+ assert user_database.name.start_with?(config.options[:db_prefix])
+ assert user_database.info # ensure db exists in couch.
+ 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_cleares_user_db
+ assert user_database.info # ensure db exists in couch.
+ delete_user
+ assert !host.databases.include?(user_database.name)
+ end
+
+ def design_docs(db)
+ db.documents(startkey: '_design', endkey: '_design'.succ)["rows"]
+ end
+end