diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2019-01-30 10:26:46 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-30 10:26:46 -0500 |
commit | 677b658d635f7bd5d39a56afc43e4c7e55989ad6 (patch) | |
tree | 02feabc1c3dd193c70cb1c1601ddc8f56f8311c2 /activerecord/test | |
parent | 9f8438a99f66136924bccf2c41bbc11c3ba69c3a (diff) | |
parent | dedcc1950613b4c756ca7fdc449d0d9315bb39aa (diff) | |
download | rails-677b658d635f7bd5d39a56afc43e4c7e55989ad6.tar.gz rails-677b658d635f7bd5d39a56afc43e4c7e55989ad6.tar.bz2 rails-677b658d635f7bd5d39a56afc43e4c7e55989ad6.zip |
Merge pull request #35102 from eileencodes/fix-case-when-url-in-url-config-is-nil
Fix case when we want a UrlConfig but the URL is nil
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/connection_adapters/merge_and_resolve_default_url_config_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/connection_adapters/merge_and_resolve_default_url_config_test.rb b/activerecord/test/cases/connection_adapters/merge_and_resolve_default_url_config_test.rb index 06c1c51724..225cccc62c 100644 --- a/activerecord/test/cases/connection_adapters/merge_and_resolve_default_url_config_test.rb +++ b/activerecord/test/cases/connection_adapters/merge_and_resolve_default_url_config_test.rb @@ -46,6 +46,14 @@ module ActiveRecord assert_equal expected, actual end + def test_resolver_with_nil_database_url_and_current_env + ENV["RAILS_ENV"] = "foo" + config = { "foo" => { "adapter" => "postgres", "url" => ENV["DATABASE_URL"] } } + actual = resolve_spec(:foo, config) + expected = { "adapter" => "postgres", "url" => nil, "name" => "foo" } + assert_equal expected, actual + end + def test_resolver_with_database_uri_and_current_env_symbol_key_and_rack_env ENV["DATABASE_URL"] = "postgres://localhost/foo" ENV["RACK_ENV"] = "foo" |