Permalink
Browse files

Add one more test case to make sure that data attributes are being

escaped
  • Loading branch information...
1 parent 61be340 commit 580fa0c7be62868ff521570d37094e22ffa81f00 @rafaelfranca rafaelfranca committed Jul 22, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 actionpack/test/template/form_options_helper_test.rb
@@ -1137,6 +1137,13 @@ def test_options_for_select_with_data_element
)
end
+ def test_options_for_select_with_data_element_with_special_characters
+ assert_dom_equal(
+ "<option value=\"&lt;Denmark&gt;\" data-test=\"&lt;bold&gt;\">&lt;Denmark&gt;</option>",
+ options_for_select([ [ "<Denmark>", { :data => { :test => '<bold>' } } ] ])
+ )
+ end
+
def test_options_for_select_with_element_attributes_and_selection
assert_dom_equal(
"<option value=\"&lt;Denmark&gt;\">&lt;Denmark&gt;</option>\n<option value=\"USA\" class=\"bold\" selected=\"selected\">USA</option>\n<option value=\"Sweden\">Sweden</option>",

0 comments on commit 580fa0c

Please sign in to comment.