diff options
author | kennyj <kennyj@gmail.com> | 2012-05-19 04:40:36 +0900 |
---|---|---|
committer | kennyj <kennyj@gmail.com> | 2012-05-19 04:53:12 +0900 |
commit | 576d7007ddff889d502a77e4868b35d4b0dcc6c7 (patch) | |
tree | 7c8e6d03fee4abb31a6ee444382ca38bc17bbe6c /activerecord/test/cases/adapters/postgresql/connection_test.rb | |
parent | a6dbc3fe7a504805572e634d39e37fd63ba7fd45 (diff) | |
download | rails-576d7007ddff889d502a77e4868b35d4b0dcc6c7.tar.gz rails-576d7007ddff889d502a77e4868b35d4b0dcc6c7.tar.bz2 rails-576d7007ddff889d502a77e4868b35d4b0dcc6c7.zip |
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.rb | 44 |
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 |