aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorJon Moss <me@jonathanmoss.me>2016-02-01 21:16:07 -0500
committerJon Moss <me@jonathanmoss.me>2016-02-01 21:49:13 -0500
commitc918a3a0691d54f0702c26aac3f47e9449fd2a24 (patch)
tree4c7ef70de7c13e3d6dd0f5ce07fafc49d50534e7 /activesupport/test
parent538bce1f7c676f4a5b3d800ed0f68ec065776a7f (diff)
downloadrails-c918a3a0691d54f0702c26aac3f47e9449fd2a24.tar.gz
rails-c918a3a0691d54f0702c26aac3f47e9449fd2a24.tar.bz2
rails-c918a3a0691d54f0702c26aac3f47e9449fd2a24.zip
Fix regression in `Hash#dig` for HashWithIndifferentAccess.
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb
index 1b66f784e4..be8583e704 100644
--- a/activesupport/test/core_ext/hash_ext_test.rb
+++ b/activesupport/test/core_ext/hash_ext_test.rb
@@ -702,6 +702,12 @@ class HashExtTest < ActiveSupport::TestCase
assert_equal h.class, h.dup.class
end
+ def test_nested_dig_indifferent_access
+ skip if RUBY_VERSION < "2.3.0"
+ data = {"this" => {"views" => 1234}}.with_indifferent_access
+ assert_equal 1234, data.dig(:this, :views)
+ end
+
def test_assert_valid_keys
assert_nothing_raised do
{ :failure => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ])