* making jam-web's test use the database.yml's test configs for connection info, not defaults (which is unix domain socket)
This commit is contained in:
parent
8b65f6063f
commit
2e61b2ba00
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue