From 2e61b2ba0094f018309e641855b5c0d070bfbe39 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 17 Nov 2012 20:32:29 -0600 Subject: [PATCH] * making jam-web's test use the database.yml's test configs for connection info, not defaults (which is unix domain socket) --- spec/spec_db.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/spec_db.rb b/spec/spec_db.rb index 13856452a..866a88c46 100644 --- a/spec/spec_db.rb +++ b/spec/spec_db.rb @@ -7,13 +7,15 @@ class SpecDb end def self.recreate_database_jdbc(db_config) - original = db_config["database"] + original = db_config["database"] + # jump into the 'postgres' database, just so we have somewhere to 'land' other than our test db, + # since we are going to drop/recreate it db_config["database"] = "postgres" ActiveRecord::Base.establish_connection(db_config) ActiveRecord::Base.connection.execute("DROP DATABASE IF EXISTS #{TEST_DB_NAME}") ActiveRecord::Base.connection.execute("CREATE DATABASE #{TEST_DB_NAME}") - JamDb::Migrator.new.migrate(:dbname => TEST_DB_NAME) - db_config["database"] = original + db_config["database"] = original + JamDb::Migrator.new.migrate(:dbname => TEST_DB_NAME, :user => db_config["username"], :password => db_config["password"], :host => db_config["host"]) end def self.recreate_database_pg