diff options
author | Akira Matsuda <ronnie@dio.jp> | 2014-09-10 19:25:01 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2014-09-10 19:25:01 +0900 |
commit | ed9d220cd1710fcfe74f61a092b8e3b42ed426da (patch) | |
tree | d0e96216dd4334837051594315fdb33a69a11ccf /railties/test/application | |
parent | 9e1a7398aa533be58647d555a9ba1897bacd7e40 (diff) | |
download | rails-ed9d220cd1710fcfe74f61a092b8e3b42ed426da.tar.gz rails-ed9d220cd1710fcfe74f61a092b8e3b42ed426da.tar.bz2 rails-ed9d220cd1710fcfe74f61a092b8e3b42ed426da.zip |
Tell the user which file is missing when config/database.yml was not found
Since cc03675d30b58e28f585720dad14e947a57ff5b the error message became like
"Could not load database configuration. No such file -"
which doesn't really tell what's actually missing.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/configuration_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index db2106aed3..f8b4ee30d8 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -980,6 +980,15 @@ module ApplicationTests assert_kind_of Hash, Rails.application.config.database_configuration end + test 'raises with proper error message if no database configuration found' do + FileUtils.rm("#{app_path}/config/database.yml") + require "#{app_path}/config/environment" + err = assert_raises RuntimeError do + Rails.application.config.database_configuration + end + assert_match 'config/database', err.message + end + test 'config.action_mailer.show_previews defaults to true in development' do Rails.env = "development" require "#{app_path}/config/environment" |