diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/parameters/serialization_test.rb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/actionpack/test/controller/parameters/serialization_test.rb b/actionpack/test/controller/parameters/serialization_test.rb index 5d389f5a4c..84193e304a 100644 --- a/actionpack/test/controller/parameters/serialization_test.rb +++ b/actionpack/test/controller/parameters/serialization_test.rb @@ -20,13 +20,26 @@ class ParametersSerializationTest < ActiveSupport::TestCase assert_not roundtripped.permitted? end - test 'yaml backwardscompatible with hash inheriting parameters' do - assert_equal ActionController::Parameters.new(key: :value), YAML.load(<<-end_of_yaml.strip_heredoc) + test 'yaml backwardscompatible with psych 2.0.8 format' do + params = YAML.load <<-end_of_yaml.strip_heredoc + --- !ruby/hash:ActionController::Parameters + key: :value + end_of_yaml + + assert_equal :value, params[:key] + assert_not params.permitted? + end + + test 'yaml backwardscompatible with psych 2.0.9+ format' do + params = YAML.load(<<-end_of_yaml.strip_heredoc) --- !ruby/hash-with-ivars:ActionController::Parameters elements: key: :value ivars: :@permitted: false end_of_yaml + + assert_equal :value, params[:key] + assert_not params.permitted? end end |