summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-04-09 09:38:56 -0700
committerelijah <elijah@riseup.net>2015-04-09 09:38:56 -0700
commit051b80d25bd0fe400769976c3210718689f832b4 (patch)
tree808ad9ff6e1172f85b3d061c80b48f11bd5917a0
parent35df265409732086402dfa172356448d1a5d315b (diff)
fix tests (don't dump dummy records in tmp_users)
-rw-r--r--tests/white-box/couchdb.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/white-box/couchdb.rb b/tests/white-box/couchdb.rb
index d0f5ce88..5ee12ff3 100644
--- a/tests/white-box/couchdb.rb
+++ b/tests/white-box/couchdb.rb
@@ -83,7 +83,6 @@ class CouchDB < LeapTest
def test_05_Do_required_databases_exist?
dbs_that_should_exist = ["customers","identities","keycache","shared","tickets","users", "tmp_users"]
- rotation_suffix = Time.now.utc.to_i / 2592000 # monthly
dbs_that_should_exist << "tokens_#{rotation_suffix}"
dbs_that_should_exist << "sessions_#{rotation_suffix}"
dbs_that_should_exist.each do |db_name|
@@ -117,7 +116,7 @@ class CouchDB < LeapTest
def test_07_Can_records_be_created?
record = DummyRecord.new
- url = couchdb_url("/tmp_users", :username => 'admin')
+ url = couchdb_url("/tokens_#{rotation_suffix}", :username => 'admin')
assert_post(url, record, :format => :json) do |body|
assert response = JSON.parse(body), "POST response should be JSON"
assert response["ok"], "POST response should be OK"
@@ -145,6 +144,10 @@ class CouchDB < LeapTest
couchdb_url(path, options)
end
+ def rotation_suffix
+ rotation_suffix = Time.now.utc.to_i / 2592000 # monthly
+ end
+
require 'securerandom'
require 'digest/sha2'
class DummyRecord < Hash