Fix for Lighthouse ticket # 6334 : to_xml should render valid xml or raise an error all the time #445

Merged
merged 1 commit into from May 8, 2011
Jump to file or symbol
Failed to load files and symbols.
+10 −0
Diff settings

Always

Just for now

@@ -87,6 +87,16 @@ def to_xml(options) options[:builder].yo(options[:root].to_s) end
@xml.to_tag(:b, "Howdy", @options)
assert_xml "<b>Howdy</b>"
end
+
+ test "#to_tag should dasherize the space when passed a string with spaces as a key" do
+ @xml.to_tag("New York", 33, @options)
+ assert_xml "<New---York type=\"integer\">33</New---York>"
+ end
+
+ test "#to_tag should dasherize the space when passed a symbol with spaces as a key" do
+ @xml.to_tag(:"New York", 33, @options)
+ assert_xml "<New---York type=\"integer\">33</New---York>"
+ end
# TODO: test the remaining functions hidden in #to_tag.
end
end