diff options
author | Terence Lee <hone02@gmail.com> | 2012-04-03 21:59:24 -0500 |
---|---|---|
committer | Terence Lee <hone02@gmail.com> | 2012-04-03 21:59:24 -0500 |
commit | d46ad3460a5c8bffae1a907a11ba6ce3fec4de87 (patch) | |
tree | e87132a819c0d6b6e7ccf782b1bbf6c06dfd8b14 /railties/test/application/initializers/active_record_test.rb | |
parent | 93f25ac6fc4493600c1648c1a60b12cc83790ad0 (diff) | |
download | rails-d46ad3460a5c8bffae1a907a11ba6ce3fec4de87.tar.gz rails-d46ad3460a5c8bffae1a907a11ba6ce3fec4de87.tar.bz2 rails-d46ad3460a5c8bffae1a907a11ba6ce3fec4de87.zip |
log which config format AR uses to connect with
Diffstat (limited to 'railties/test/application/initializers/active_record_test.rb')
-rw-r--r-- | railties/test/application/initializers/active_record_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/railties/test/application/initializers/active_record_test.rb b/railties/test/application/initializers/active_record_test.rb index 4a0b8fd56a..edf78a8a0a 100644 --- a/railties/test/application/initializers/active_record_test.rb +++ b/railties/test/application/initializers/active_record_test.rb @@ -39,5 +39,24 @@ module ApplicationTests # clean up FileUtils.rm("#{app_path}/#{database_path}") end + + test "DATABASE_URL env var takes precedence over config/database.yml" do + database_path = "/db/foo.sqlite3" + ENV['DATABASE_URL'] = "sqlite3://#{database_path}" + simple_controller + + get '/foo' + assert File.read("#{app_path}/log/production.log").include?("DATABASE_URL") + + # clean up + FileUtils.rm("#{app_path}/#{database_path}") + end + + test "logs the use of config/database.yml" do + simple_controller + + get '/foo' + assert File.read("#{app_path}/log/production.log").include?("database.yml") + end end end |