Skip to content
Browse files

Lighthouse ticket # 6334; added tests to verify that spaces in key ar…

…e dasherized.
  • Loading branch information...
1 parent 80bf68a commit 6b31fd8070dff823a020946a57fc83b41e17a0c1 @prakashmurthy prakashmurthy committed May 8, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 activesupport/test/xml_mini_test.rb
View
10 activesupport/test/xml_mini_test.rb
@@ -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

0 comments on commit 6b31fd8

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