1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

escaped
This commit is contained in:
Rafael Mendonça França 2012-07-22 13:57:42 -03:00
parent 61be3401ee
commit 580fa0c7be

View file

@ -1137,6 +1137,13 @@ class FormOptionsHelperTest < ActionView::TestCase
)
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>",