From c31cc963daac55f6a3bca9da99b619276911dbd7 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 5 Jan 2013 17:46:26 -0700 Subject: Revert "Merge branch 'master-sec'" This reverts commit 88cc1688d0cb828c17706b41a8bd27870f2a2beb, reversing changes made to f049016cd348627bf8db0d72382d7580bf802a79. --- activesupport/test/core_ext/hash_ext_test.rb | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'activesupport/test') diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb index 30d95b75bc..84dd9bc983 100644 --- a/activesupport/test/core_ext/hash_ext_test.rb +++ b/activesupport/test/core_ext/hash_ext_test.rb @@ -1015,10 +1015,12 @@ class HashToXmlTest < ActiveSupport::TestCase 2592000000 2003-07-16 2003-07-16T09:28:00+0000 + --- \n1: should be an integer\n:message: Have a nice day\narray: \n- should-have-dashes: true\n should_have_underscores: true\n david@loudthinking.com 1.5 135 + yes EOT @@ -1031,10 +1033,12 @@ class HashToXmlTest < ActiveSupport::TestCase :replies_close_in => 2592000000, :written_on => Date.new(2003, 7, 16), :viewed_at => Time.utc(2003, 7, 16, 9, 28), + :content => { :message => "Have a nice day", 1 => "should be an integer", "array" => [{ "should-have-dashes" => true, "should_have_underscores" => true }] }, :author_email_address => "david@loudthinking.com", :parent_id => nil, :ad_revenue => BigDecimal("1.50"), :optimum_viewing_angle => 135.0, + :resident => :yes }.stringify_keys assert_equal expected_topic_hash, Hash.from_xml(topic_xml)["topic"] @@ -1048,6 +1052,7 @@ class HashToXmlTest < ActiveSupport::TestCase + EOT @@ -1058,6 +1063,7 @@ class HashToXmlTest < ActiveSupport::TestCase :approved => nil, :written_on => nil, :viewed_at => nil, + :content => nil, :parent_id => nil }.stringify_keys @@ -1284,28 +1290,6 @@ class HashToXmlTest < ActiveSupport::TestCase assert_equal expected_product_hash, Hash.from_xml(product_xml)["product"] end - def test_from_xml_raises_on_disallowed_type_attributes - assert_raise ActiveSupport::XMLConverter::DisallowedType do - Hash.from_xml 'value', %w(foo) - end - end - - def test_from_xml_disallows_symbol_and_yaml_types_by_default - assert_raise ActiveSupport::XMLConverter::DisallowedType do - Hash.from_xml 'value' - end - - assert_raise ActiveSupport::XMLConverter::DisallowedType do - Hash.from_xml 'value' - end - end - - def test_from_trusted_xml_allows_symbol_and_yaml_types - expected = { 'product' => { 'name' => :value }} - assert_equal expected, Hash.from_trusted_xml('value') - assert_equal expected, Hash.from_trusted_xml(':value') - end - def test_should_use_default_value_for_unknown_key hash_wia = HashWithIndifferentAccess.new(3) assert_equal 3, hash_wia[:new_key] -- cgit v1.2.3