From d72a0cbc807a14d3eec02a53317d11b9d9fa5815 Mon Sep 17 00:00:00 2001 From: Matthew Draper Date: Wed, 9 Apr 2014 01:41:11 +0930 Subject: Drop in @jeremy's new database.yml template text In passing, allow multi-word adapters to be referenced in a URL: underscored_name must become hyphened-name. --- .../test/cases/connection_adapters/connection_handler_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/connection_adapters/connection_handler_test.rb b/activerecord/test/cases/connection_adapters/connection_handler_test.rb index 256ddd7d23..f2d18e812d 100644 --- a/activerecord/test/cases/connection_adapters/connection_handler_test.rb +++ b/activerecord/test/cases/connection_adapters/connection_handler_test.rb @@ -89,6 +89,14 @@ module ActiveRecord assert_equal expect_prod, actual["default_env"] end + def test_url_with_hyphenated_scheme + ENV['DATABASE_URL'] = "ibm-db://localhost/foo" + config = { "default_env" => { "adapter" => "not_postgres", "database" => "not_foo", "host" => "localhost" } } + actual = resolve(:default_env, config) + expected = { "adapter"=>"ibm_db", "database"=>"foo", "host"=>"localhost" } + assert_equal expected, actual + end + def test_string_connection config = { "default_env" => "postgres://localhost/foo" } actual = klass.new(config).resolve -- cgit v1.2.3