diff options
author | Jeremy Baker <jhubert@gmail.com> | 2016-02-04 10:59:52 -0800 |
---|---|---|
committer | Jeremy Baker <jhubert@gmail.com> | 2016-02-04 10:59:52 -0800 |
commit | d871696b4a8b021b67a3ce6c3cb5d5dcbbb578fe (patch) | |
tree | 34df90aa9d02d2125f9d628a65098805e339e8c7 | |
parent | 7429bc58a0dffa94636b21cc0cba1d19a5ae7a84 (diff) | |
download | rails-d871696b4a8b021b67a3ce6c3cb5d5dcbbb578fe.tar.gz rails-d871696b4a8b021b67a3ce6c3cb5d5dcbbb578fe.tar.bz2 rails-d871696b4a8b021b67a3ce6c3cb5d5dcbbb578fe.zip |
Add a resolver test for the missing scheme
-rw-r--r-- | activerecord/test/cases/connection_adapters/connection_specification_test.rb | 5 | ||||
-rw-r--r-- | activerecord/test/cases/connection_specification/resolver_test.rb | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/test/cases/connection_adapters/connection_specification_test.rb b/activerecord/test/cases/connection_adapters/connection_specification_test.rb index ea2196cda2..99fe7020ea 100644 --- a/activerecord/test/cases/connection_adapters/connection_specification_test.rb +++ b/activerecord/test/cases/connection_adapters/connection_specification_test.rb @@ -7,6 +7,11 @@ module ActiveRecord spec = ConnectionSpecification.new({ :a => :b }, "bar") assert_not_equal(spec.config.object_id, spec.dup.config.object_id) end + + def test_handle_missing_scheme + spec = ConnectionSpecification.new({ :url => 'testing' }, "bar") + assert_not_equal(spec.config.object_id, spec.dup.config.object_id) + end end end end diff --git a/activerecord/test/cases/connection_specification/resolver_test.rb b/activerecord/test/cases/connection_specification/resolver_test.rb index 3c2f5d4219..358b6ad537 100644 --- a/activerecord/test/cases/connection_specification/resolver_test.rb +++ b/activerecord/test/cases/connection_specification/resolver_test.rb @@ -57,6 +57,12 @@ module ActiveRecord "encoding" => "utf8" }, spec) end + def test_url_missing_scheme + spec = resolve 'foo' + assert_equal({ + "database" => "foo" }, spec) + end + def test_url_host_db spec = resolve 'abstract://foo/bar?encoding=utf8' assert_equal({ |