diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-10-28 10:02:35 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-10-30 18:12:26 +0100 |
commit | d0ea5c5b20687520740bad636951973a34ac2e68 (patch) | |
tree | 88d7f80e9831c0177b7ea7a2474ef0b7b70df9ba /activerecord/test | |
parent | bbb32d205f2391be21d40ad64b693a4c0d9aa534 (diff) | |
download | rails-d0ea5c5b20687520740bad636951973a34ac2e68.tar.gz rails-d0ea5c5b20687520740bad636951973a34ac2e68.tar.bz2 rails-d0ea5c5b20687520740bad636951973a34ac2e68.zip |
fix code typo in `MysqlAdapter` .Closes #12647.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 4de92b71be..82b20e8cee 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -604,10 +604,25 @@ class BasicsTest < ActiveRecord::TestCase end def test_unicode_column_name + Weird.reset_column_information weird = Weird.create(:なまえ => 'たこ焼き仮面') assert_equal 'たこ焼き仮面', weird.なまえ end + def test_respect_internal_encoding + if current_adapter?(:PostgreSQLAdapter) + skip 'pg does not respect internal encoding and always returns utf8' + end + old_default_internal = Encoding.default_internal + silence_warnings { Encoding.default_internal = "EUC-JP" } + + Weird.reset_column_information + + assert_equal ["EUC-JP"], Weird.columns.map {|c| c.name.encoding.name }.uniq + ensure + silence_warnings { Encoding.default_internal = old_default_internal } + end + def test_non_valid_identifier_column_name weird = Weird.create('a$b' => 'value') weird.reload |