mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Test xml renderer
This commit is contained in:
parent
7bd1717865
commit
94e271bdaf
1 changed files with 14 additions and 0 deletions
|
@ -158,4 +158,18 @@ describe Hamlit::RailsTemplate do
|
|||
Hamlit::RailsTemplate.set_options(use_html_safe: original)
|
||||
end
|
||||
end
|
||||
|
||||
specify 'xml mime_type' do
|
||||
base = ActionView::Base.new(__dir__, {})
|
||||
handler = Hamlit::RailsTemplate.new
|
||||
html_template = ActionView::Template.new('%link', 'test.html.haml', handler, {
|
||||
format: Mime::Type.new('text/html', :html, ['application/xhtml+xml']),
|
||||
})
|
||||
xml_template = ActionView::Template.new('%link', 'test.xml.haml', handler, {
|
||||
format: Mime::Type.new('application/xml', :xml, ['text/xml', 'application/x-xml']),
|
||||
})
|
||||
|
||||
assert_equal %Q|<link>\n|, base.render(template: html_template)
|
||||
assert_equal %Q|<link />\n|, base.render(template: xml_template)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue