diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2019-05-14 03:29:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-14 03:29:37 -0400 |
commit | bd0618b1f3c684a7b5294e05e7c9abb0fd5b42d8 (patch) | |
tree | bc51df2c2716d1ed434329622b83c7fc09549f5b /railties/test | |
parent | 7edb63009ed64bd227eaffd4ec1d7e662eb96f62 (diff) | |
parent | 5df84533d5c93e32dff35a9ec51d7f1009793bfb (diff) | |
download | rails-bd0618b1f3c684a7b5294e05e7c9abb0fd5b42d8.tar.gz rails-bd0618b1f3c684a7b5294e05e7c9abb0fd5b42d8.tar.bz2 rails-bd0618b1f3c684a7b5294e05e7c9abb0fd5b42d8.zip |
Merge pull request #36237 from eileencodes/fix-erb-in-database-yaml-again
Fix database loading when ERB is single line ternary
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/rake/dbs_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/railties/test/application/rake/dbs_test.rb b/railties/test/application/rake/dbs_test.rb index 258066a7e6..ca2d45b1c9 100644 --- a/railties/test/application/rake/dbs_test.rb +++ b/railties/test/application/rake/dbs_test.rb @@ -122,6 +122,22 @@ module ApplicationTests db_create_and_drop("db/development.sqlite3", environment_loaded: false) end + test "db:create and db:drop dont raise errors when loading YAML with FIXME ERB" do + app_file "config/database.yml", <<-YAML + development: + <%= Rails.application.config.database ? 'database: db/development.sqlite3' : 'database: db/development.sqlite3' %> + adapter: sqlite3 + YAML + + app_file "config/environments/development.rb", <<-RUBY + Rails.application.configure do + config.database = "db/development.sqlite3" + end + RUBY + + db_create_and_drop("db/development.sqlite3", environment_loaded: false) + end + def with_database_existing Dir.chdir(app_path) do set_database_url |