diff options
Diffstat (limited to 'railties/test/application/initializers')
-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 |