Skip to content

Commit

Permalink
Adding tests for file_from_xml for XmlMini_JDOM #jruby
Browse files Browse the repository at this point in the history
  • Loading branch information
arunagw committed May 26, 2011
1 parent d164663 commit 0094351
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions activesupport/test/xml_mini/jdom_engine_test.rb
Expand Up @@ -15,20 +15,20 @@ def teardown
XmlMini.backend = @default_backend
end

# def test_file_from_xml
# hash = Hash.from_xml(<<-eoxml)
# <blog>
# <logo type="file" name="logo.png" content_type="image/png">
# </logo>
# </blog>
# eoxml
# assert hash.has_key?('blog')
# assert hash['blog'].has_key?('logo')
#
# file = hash['blog']['logo']
# assert_equal 'logo.png', file.original_filename
# assert_equal 'image/png', file.content_type
# end
def test_file_from_xml
hash = Hash.from_xml(<<-eoxml)
<blog>
<logo type="file" name="logo.png" content_type="image/png">
</logo>
</blog>
eoxml
assert hash.has_key?('blog')
assert hash['blog'].has_key?('logo')

file = hash['blog']['logo']
assert_equal 'logo.png', file.original_filename
assert_equal 'image/png', file.content_type
end

def test_exception_thrown_on_expansion_attack
assert_raise NativeException do
Expand Down

0 comments on commit 0094351

Please sign in to comment.