aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql/connection_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-05-30 11:06:49 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2012-05-30 11:06:49 -0700
commit7c1b61e50ee44abd4f6440067ec11f7ccd01df3c (patch)
tree9500acc572eb8c9f8cc52b60b028cb5083251712 /activerecord/test/cases/adapters/postgresql/connection_test.rb
parent9ed62ade5f2972cfc978cf2744cdd81215f8ff8f (diff)
parent576d7007ddff889d502a77e4868b35d4b0dcc6c7 (diff)
downloadrails-7c1b61e50ee44abd4f6440067ec11f7ccd01df3c.tar.gz
rails-7c1b61e50ee44abd4f6440067ec11f7ccd01df3c.tar.bz2
rails-7c1b61e50ee44abd4f6440067ec11f7ccd01df3c.zip
Merge pull request #6386 from kennyj/fix_logs_name_consistency
Fix logs name consistency.
Diffstat (limited to 'activerecord/test/cases/adapters/postgresql/connection_test.rb')
-rw-r--r--activerecord/test/cases/adapters/postgresql/connection_test.rb44
1 files changed, 44 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/connection_test.rb b/activerecord/test/cases/adapters/postgresql/connection_test.rb
index 4baec749ff..adb2cef010 100644
--- a/activerecord/test/cases/adapters/postgresql/connection_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/connection_test.rb
@@ -8,6 +8,13 @@ module ActiveRecord
def setup
super
@connection = ActiveRecord::Base.connection
+ @connection.extend(LogIntercepter)
+ @connection.intercepted = true
+ end
+
+ def teardown
+ @connection.intercepted = false
+ @connection.logged = []
end
def test_encoding
@@ -25,5 +32,42 @@ module ActiveRecord
expect = NonExistentTable.connection.query('show geqo').first.first
assert_equal 'off', expect
end
+
+ def test_tables_logs_name
+ @connection.tables('hello')
+ assert_equal 'SCHEMA', @connection.logged[0][1]
+ end
+
+ def test_indexes_logs_name
+ @connection.indexes('items', 'hello')
+ assert_equal 'SCHEMA', @connection.logged[0][1]
+ end
+
+ def test_table_exists_logs_name
+ @connection.table_exists?('items')
+ assert_equal 'SCHEMA', @connection.logged[0][1]
+ end
+
+ def test_table_alias_length_logs_name
+ @connection.instance_variable_set("@table_alias_length", nil)
+ @connection.table_alias_length
+ assert_equal 'SCHEMA', @connection.logged[0][1]
+ end
+
+ def test_current_database_logs_name
+ @connection.current_database
+ assert_equal 'SCHEMA', @connection.logged[0][1]
+ end
+
+ def test_encoding_logs_name
+ @connection.encoding
+ assert_equal 'SCHEMA', @connection.logged[0][1]
+ end
+
+ def test_schema_names_logs_name
+ @connection.schema_names
+ assert_equal 'SCHEMA', @connection.logged[0][1]
+ end
+
end
end