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:
parent
61be3401ee
commit
580fa0c7be
1 changed files with 7 additions and 0 deletions
|
@ -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=\"<Denmark>\" data-test=\"<bold>\"><Denmark></option>",
|
||||
options_for_select([ [ "<Denmark>", { :data => { :test => '<bold>' } } ] ])
|
||||
)
|
||||
end
|
||||
|
||||
def test_options_for_select_with_element_attributes_and_selection
|
||||
assert_dom_equal(
|
||||
"<option value=\"<Denmark>\"><Denmark></option>\n<option value=\"USA\" class=\"bold\" selected=\"selected\">USA</option>\n<option value=\"Sweden\">Sweden</option>",
|
||||
|
|
Loading…
Reference in a new issue