aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/base_test.rb
diff options
context:
space:
mode:
authorStephen Celis <stephen@stephencelis.com>2012-01-19 11:12:21 -0800
committerStephen Celis <stephen@stephencelis.com>2012-01-20 10:44:08 -0800
commit920070e42b33c5bdaf62977ed22aa867a455ffd5 (patch)
tree00af6951abc877afb68513f9b6743c99cb0bd95b /activerecord/test/cases/base_test.rb
parent30b0e5848c5a91c0bfd1ef33ec4b9bc36bcead0b (diff)
downloadrails-920070e42b33c5bdaf62977ed22aa867a455ffd5.tar.gz
rails-920070e42b33c5bdaf62977ed22aa867a455ffd5.tar.bz2
rails-920070e42b33c5bdaf62977ed22aa867a455ffd5.zip
Don't type-cast unknown types to YAML.
Diffstat (limited to 'activerecord/test/cases/base_test.rb')
-rw-r--r--activerecord/test/cases/base_test.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb
index 3ab6973549..b09677efd0 100644
--- a/activerecord/test/cases/base_test.rb
+++ b/activerecord/test/cases/base_test.rb
@@ -992,10 +992,9 @@ class BasicsTest < ActiveRecord::TestCase
assert_equal "b", duped_topic.title
# test if the attribute values have been duped
- topic.title = {"a" => "b"}
duped_topic = topic.dup
- duped_topic.title["a"] = "c"
- assert_equal "b", topic.title["a"]
+ duped_topic.title.replace "c"
+ assert_equal "a", topic.title
# test if attributes set as part of after_initialize are duped correctly
assert_equal topic.author_email_address, duped_topic.author_email_address
@@ -1006,8 +1005,7 @@ class BasicsTest < ActiveRecord::TestCase
assert_not_equal duped_topic.id, topic.id
duped_topic.reload
- # FIXME: I think this is poor behavior, and will fix it with #5686
- assert_equal({'a' => 'c'}.to_yaml, duped_topic.title)
+ assert_equal("c", duped_topic.title)
end
def test_dup_with_aggregate_of_same_name_as_attribute