diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-28 17:01:01 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-29 02:04:24 -0200 |
commit | d40309a0b8faaea766f8cf89b36d2323a1d35d88 (patch) | |
tree | ad1c1db16b8afd8fcbd55ca89d7509206f8a2084 /activerecord/test/cases/adapters/sqlite3 | |
parent | cdfa4a5f869b42fc3894e777d94b976ece28f716 (diff) | |
download | rails-d40309a0b8faaea766f8cf89b36d2323a1d35d88.tar.gz rails-d40309a0b8faaea766f8cf89b36d2323a1d35d88.tar.bz2 rails-d40309a0b8faaea766f8cf89b36d2323a1d35d88.zip |
Merge pull request #8057 from frodsan/fix_sqlite_mutate_arg
SQLite3Adapter#type_cast should not mutate arguments
Conflicts:
activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
Diffstat (limited to 'activerecord/test/cases/adapters/sqlite3')
-rw-r--r-- | activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb b/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb index 97b56d38d7..ec69a36174 100644 --- a/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb +++ b/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb @@ -164,6 +164,14 @@ module ActiveRecord end end + def test_type_cast_should_not_mutate_encoding + return skip('only test encoding on 1.9') unless "<3".encoding_aware? + + name = 'hello'.force_encoding(Encoding::ASCII_8BIT) + owner = Owner.create(:name => name) + assert_equal Encoding::ASCII_8BIT, name.encoding + end + def test_execute @conn.execute "INSERT INTO items (number) VALUES (10)" records = @conn.execute "SELECT * FROM items" |