Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Extract test database config to test/support/database.yml(.example) a…

…nd ignore the active config for easier config management across different systems/collaborators
  • Loading branch information...
commit 432df16f0a58c26437683fb12bd9321bb3e0b807 1 parent 4fc8ccc
@Empact Empact authored committed
View
3  .gitignore
@@ -1,4 +1,5 @@
.DS_Store
pkg
doc
-Manifest
+Manifest
+test/support/database.yml
View
4 test/sexy_pg_constraints_test.rb
@@ -1,7 +1,7 @@
require File.dirname(__FILE__) + '/test_helper.rb'
-# Database spc_test should be created manually.
-ActiveRecord::Base.establish_connection(:adapter => "postgresql", :database => "spc_test")
+db_config_path = File.join(File.dirname(__FILE__), 'support', 'database.yml')
+ActiveRecord::Base.establish_connection(YAML::load(open(db_config_path)))
# Setting up sample migrations
class CreateBooks < ActiveRecord::Migration
View
6 test/support/database.yml.example
@@ -0,0 +1,6 @@
+adapter: postgresql
+host: localhost
+port: 5432
+username: postgres
+database: spc_test
+encoding: utf8
Please sign in to comment.
Something went wrong with that request. Please try again.