Skip to content
Browse files

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
  • Loading branch information...
1 parent 4e0028f commit 7e46571115735373ad5993468c8891016057fbb2 @jamis jamis committed Mar 18, 2006
Showing with 8 additions and 0 deletions.
  1. +8 −0 actionpack/test/controller/webservice_test.rb
View
8 actionpack/test/controller/webservice_test.rb
@@ -134,6 +134,14 @@ def test_typecast_as_xml
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)

0 comments on commit 7e46571

Please sign in to comment.
Something went wrong with that request. Please try again.