diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-30 19:36:06 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-30 19:36:06 -0800 |
commit | 969a0778cd2fd809a7b4f60c8477bb6d0ac9faf3 (patch) | |
tree | 6d71bcbc0c3031cc2aa2336024e873b931f1eec1 /activerecord/test/cases | |
parent | 16e93561e2695afb6e0f264905e35ffd9381123d (diff) | |
parent | 5b96027ef6ac6e507ec9caf9973069345ce6a7cd (diff) | |
download | rails-969a0778cd2fd809a7b4f60c8477bb6d0ac9faf3.tar.gz rails-969a0778cd2fd809a7b4f60c8477bb6d0ac9faf3.tar.bz2 rails-969a0778cd2fd809a7b4f60c8477bb6d0ac9faf3.zip |
Merge pull request #13541 from schneems/schneems/db-url-sub-key
Allow "url" sub key in database.yml configuration
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/connection_specification/resolver_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/activerecord/test/cases/connection_specification/resolver_test.rb b/activerecord/test/cases/connection_specification/resolver_test.rb index ba8440a16b..fdd1914cba 100644 --- a/activerecord/test/cases/connection_specification/resolver_test.rb +++ b/activerecord/test/cases/connection_specification/resolver_test.rb @@ -31,6 +31,24 @@ module ActiveRecord "encoding" => "utf8" }, spec) end + def test_url_sub_key + spec = resolve :production, 'production' => {"url" => 'abstract://foo?encoding=utf8'} + assert_equal({ + "adapter" => "abstract", + "host" => "foo", + "encoding" => "utf8" }, spec) + end + + def test_url_sub_key_merges_correctly + hash = {"url" => 'abstract://foo?encoding=utf8&', "adapter" => "sqlite3", "host" => "bar", "pool" => "3"} + spec = resolve :production, 'production' => hash + assert_equal({ + "adapter" => "abstract", + "host" => "foo", + "encoding" => "utf8", + "pool" => "3" }, spec) + end + def test_url_host_no_db spec = resolve 'abstract://foo?encoding=utf8' assert_equal({ |