aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-11-01 13:21:09 -0400
committerGitHub <noreply@github.com>2018-11-01 13:21:09 -0400
commitd80925b169f0db950697868f5659a67cc03e8654 (patch)
treee7bbfbb1db57b4aff6e44f86d90aeb09ef309b8c /activesupport/test
parent7ac05a804d1f204ced084ed141e5aa00e4caeb3e (diff)
parent4ba5386e6c647b285490b0a9f44fcf617daeda41 (diff)
downloadrails-d80925b169f0db950697868f5659a67cc03e8654.tar.gz
rails-d80925b169f0db950697868f5659a67cc03e8654.tar.bz2
rails-d80925b169f0db950697868f5659a67cc03e8654.zip
Merge pull request #34360 from weilandia/34359_hash_with_indifferent_access_to_options
Make ActiveSupport HashWithIndifferentAccess#to_options and alias for HashWithIndifferentAccess#symbolize_keys
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/hash_with_indifferent_access_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/test/hash_with_indifferent_access_test.rb b/activesupport/test/hash_with_indifferent_access_test.rb
index af67ed21c8..f81e0dc70f 100644
--- a/activesupport/test/hash_with_indifferent_access_test.rb
+++ b/activesupport/test/hash_with_indifferent_access_test.rb
@@ -57,6 +57,13 @@ class HashWithIndifferentAccessTest < ActiveSupport::TestCase
assert_equal @symbols, @mixed.with_indifferent_access.symbolize_keys
end
+ def test_to_options_for_hash_with_indifferent_access
+ assert_instance_of Hash, @symbols.with_indifferent_access.to_options
+ assert_equal @symbols, @symbols.with_indifferent_access.to_options
+ assert_equal @symbols, @strings.with_indifferent_access.to_options
+ assert_equal @symbols, @mixed.with_indifferent_access.to_options
+ end
+
def test_deep_symbolize_keys_for_hash_with_indifferent_access
assert_instance_of Hash, @nested_symbols.with_indifferent_access.deep_symbolize_keys
assert_equal @nested_symbols, @nested_symbols.with_indifferent_access.deep_symbolize_keys