aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-05-14 12:39:48 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-05-14 12:39:48 -0700
commitc7182563e59c7d32105211f3dfb0bcb6db74ab85 (patch)
treeca729508d736eeef104bded6af7fa6d721863ffe /activesupport/test
parente8e7d8357c5f641842f5c4730396fae4d423723a (diff)
parentdf24b8790f22384a068fece7042f04ffd2fcb33e (diff)
downloadrails-c7182563e59c7d32105211f3dfb0bcb6db74ab85.tar.gz
rails-c7182563e59c7d32105211f3dfb0bcb6db74ab85.tar.bz2
rails-c7182563e59c7d32105211f3dfb0bcb6db74ab85.zip
Merge pull request #10266 from vipulnsward/fix_HIA_to_hash
fix HashWithIndifferentAccess#to_hash behaviour
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb
index 30d95b75bc..b385e806bc 100644
--- a/activesupport/test/core_ext/hash_ext_test.rb
+++ b/activesupport/test/core_ext/hash_ext_test.rb
@@ -490,6 +490,10 @@ class HashExtTest < ActiveSupport::TestCase
roundtrip = mixed_with_default.with_indifferent_access.to_hash
assert_equal @strings, roundtrip
assert_equal '1234', roundtrip.default
+ new_to_hash = @nested_mixed.with_indifferent_access.to_hash
+ assert_not new_to_hash.instance_of?(HashWithIndifferentAccess)
+ assert_not new_to_hash["a"].instance_of?(HashWithIndifferentAccess)
+ assert_not new_to_hash["a"]["b"].instance_of?(HashWithIndifferentAccess)
end
def test_lookup_returns_the_same_object_that_is_stored_in_hash_indifferent_access