aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorEileen M. Uchitelle <eileencodes@users.noreply.github.com>2019-07-15 09:11:36 -0400
committerGitHub <noreply@github.com>2019-07-15 09:11:36 -0400
commit79ef8310bec5eb2e3d05134b36bccda821703652 (patch)
treef2166e8359f06787a8d5e240322df949e66e0226 /railties/test
parentb4c715fe63d81b0dd0f7c10ac95bf17b0f897c7c (diff)
parent0fa41f72fcb773bd32c7ce77f9df33e328ff0e44 (diff)
downloadrails-79ef8310bec5eb2e3d05134b36bccda821703652.tar.gz
rails-79ef8310bec5eb2e3d05134b36bccda821703652.tar.bz2
rails-79ef8310bec5eb2e3d05134b36bccda821703652.zip
Merge pull request #36663 from igor04/load_database_yaml_fix
Prevent exception of loading database yaml with blank config file
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/configuration_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index f6bec3242a..a05d86f738 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -1793,6 +1793,11 @@ module ApplicationTests
assert_equal [X, D], C.descendants
end
+ test "load_database_yaml returns blank hash if configuration file is blank" do
+ app_file "config/database.yml", ""
+ app "development"
+ assert_equal({}, Rails.application.config.load_database_yaml)
+ end
test "raises with proper error message if no database configuration found" do
FileUtils.rm("#{app_path}/config/database.yml")