diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-05-29 13:34:23 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-05-29 13:34:47 -0700 |
commit | 912904caee1e037e2f71d6ede35a3758c15f276d (patch) | |
tree | 2384c2a13db76ae767f96e114870178fb93debb1 /activerecord/test/cases | |
parent | 214423f40171bf7d3165d70507ab17803b2fbf07 (diff) | |
download | rails-912904caee1e037e2f71d6ede35a3758c15f276d.tar.gz rails-912904caee1e037e2f71d6ede35a3758c15f276d.tar.bz2 rails-912904caee1e037e2f71d6ede35a3758c15f276d.zip |
Move `type_cast_for_write` behavior over to the serialized type object
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/attribute_methods/serialization_test.rb | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/activerecord/test/cases/attribute_methods/serialization_test.rb b/activerecord/test/cases/attribute_methods/serialization_test.rb deleted file mode 100644 index 2e3bcadab1..0000000000 --- a/activerecord/test/cases/attribute_methods/serialization_test.rb +++ /dev/null @@ -1,29 +0,0 @@ -require "cases/helper" - -module ActiveRecord - module AttributeMethods - class SerializationTest < ActiveSupport::TestCase - class FakeColumn < Struct.new(:name) - def type; :integer; end - def type_cast(s); "#{s}!"; end - end - - class NullCoder - def load(v); v; end - end - - def test_type_cast_serialized_value - value = Serialization::Attribute.new(NullCoder.new, "Hello world", :serialized) - type = Type::Serialized.new(FakeColumn.new) - assert_equal "Hello world!", type.type_cast(value) - end - - def test_type_cast_unserialized_value - value = Serialization::Attribute.new(nil, "Hello world", :unserialized) - type = Type::Serialized.new(FakeColumn.new) - type.type_cast(value) - assert_equal "Hello world", type.type_cast(value) - end - end - end -end |