diff options
author | Gannon McGibbon <gannon.mcgibbon@gmail.com> | 2018-09-24 13:20:03 -0400 |
---|---|---|
committer | Gannon McGibbon <gannon.mcgibbon@gmail.com> | 2018-09-24 13:43:47 -0400 |
commit | 63c4e9765b53ae1f8b4674c45012295f873a40be (patch) | |
tree | 16844c8ead17b266a0b7608d082a714eccf75164 /activerecord/test/cases/connection_adapters | |
parent | 06274428e534f8e12fc7d6904a89678b23c5b404 (diff) | |
download | rails-63c4e9765b53ae1f8b4674c45012295f873a40be.tar.gz rails-63c4e9765b53ae1f8b4674c45012295f873a40be.tar.bz2 rails-63c4e9765b53ae1f8b4674c45012295f873a40be.zip |
Stringify database configurations
Diffstat (limited to 'activerecord/test/cases/connection_adapters')
-rw-r--r-- | activerecord/test/cases/connection_adapters/connection_handler_test.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/activerecord/test/cases/connection_adapters/connection_handler_test.rb b/activerecord/test/cases/connection_adapters/connection_handler_test.rb index 8c204a2692..6e11b4bb87 100644 --- a/activerecord/test/cases/connection_adapters/connection_handler_test.rb +++ b/activerecord/test/cases/connection_adapters/connection_handler_test.rb @@ -151,6 +151,30 @@ module ActiveRecord ActiveRecord::Base.configurations = @prev_configs end + def test_symbolized_configurations_assignment + @prev_configs = ActiveRecord::Base.configurations + config = { + development: { + primary: { + adapter: "sqlite3", + database: "db/development.sqlite3", + }, + }, + test: { + primary: { + adapter: "sqlite3", + database: "db/test.sqlite3", + }, + }, + } + ActiveRecord::Base.configurations = config + ActiveRecord::Base.configurations.configs_for.each do |config| + assert_instance_of ActiveRecord::DatabaseConfigurations::HashConfig, config + end + ensure + ActiveRecord::Base.configurations = @prev_configs + end + def test_retrieve_connection assert @handler.retrieve_connection(@spec_name) end |