Add a test to make sure basic XML entities get unescaped properly

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3918 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2006-03-18 06:21:04 +00:00
parent 4e0028fbab
commit 7e46571115
1 changed files with 8 additions and 0 deletions

View File

@ -134,6 +134,14 @@ class WebServiceTest < Test::Unit::TestCase
assert_equal [1, "hello", Date.new(1974,7,25)], params[:data][:g]
end
def test_entities_unescaped_as_xml_simple
ActionController::Base.param_parsers[Mime::XML] = :xml_simple
process('POST', 'application/xml', <<-XML)
<data>&lt;foo &quot;bar&apos;s&quot; &amp; friends&gt;</data>
XML
assert_equal %(<foo "bar's" & friends>), @controller.params[:data]
end
def test_dasherized_keys_as_yaml
ActionController::Base.param_parsers[Mime::YAML] = :yaml
process('POST', 'application/x-yaml', "---\nfirst-key:\n sub-key: ...\n", true)