aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/adapter_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapter_test.rb b/activerecord/test/cases/adapter_test.rb
index da57349d93..52496bf221 100644
--- a/activerecord/test/cases/adapter_test.rb
+++ b/activerecord/test/cases/adapter_test.rb
@@ -96,6 +96,19 @@ class AdapterTest < ActiveRecord::TestCase
def test_encoding
assert_not_nil @connection.encoding
end
+
+ def test_connect_with_url
+ begin
+ ar_config = ARTest.connection_config['arunit']
+ url = "postgres://#{ar_config["username"]}@localhost/#{ar_config["database"]}?encoding=utf8"
+ ActiveRecord::Base.establish_connection(url)
+ connection = ActiveRecord::Base.connection
+ assert_equal ar_config['database'], connection.current_database
+ assert_equal "UTF8", connection.encoding
+ ensure
+ ActiveRecord::Base.establish_connection 'arunit'
+ end
+ end
end
def test_table_alias