diff options
Diffstat (limited to 'railties/test/application/rake')
-rw-r--r-- | railties/test/application/rake/dbs_test.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/railties/test/application/rake/dbs_test.rb b/railties/test/application/rake/dbs_test.rb index ca2d45b1c9..e08cd09abd 100644 --- a/railties/test/application/rake/dbs_test.rb +++ b/railties/test/application/rake/dbs_test.rb @@ -138,6 +138,23 @@ module ApplicationTests db_create_and_drop("db/development.sqlite3", environment_loaded: false) end + test "db:create and db:drop don't raise errors when loading YAML which contains a key's value as an ERB statement" do + app_file "config/database.yml", <<-YAML + development: + database: <%= Rails.application.config.database ? 'db/development.sqlite3' : 'db/development.sqlite3' %> + custom_option: <%= ENV['CUSTOM_OPTION'] %> + 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 |