diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-05-16 20:52:27 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-05-16 20:53:28 -0300 |
commit | 982ed06b3ab963bd3bd0beb50f948bba803fdc4c (patch) | |
tree | 7fd554f7b7734088eca2ce083145f95e861b6139 /actionpack/test | |
parent | 6f04975272c901e59fe0f062ca76680c5cebfe6b (diff) | |
download | rails-982ed06b3ab963bd3bd0beb50f948bba803fdc4c.tar.gz rails-982ed06b3ab963bd3bd0beb50f948bba803fdc4c.tar.bz2 rails-982ed06b3ab963bd3bd0beb50f948bba803fdc4c.zip |
Make :prompt work as documented
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/form_options_helper_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionpack/test/template/form_options_helper_test.rb index 048fb622ed..9b64bc9d81 100644 --- a/actionpack/test/template/form_options_helper_test.rb +++ b/actionpack/test/template/form_options_helper_test.rb @@ -320,6 +320,13 @@ class FormOptionsHelperTest < ActionView::TestCase ) end + def test_grouped_options_for_select_with_selected_and_prompt_true + assert_dom_equal( + "<option value=\"\">Please select</option><optgroup label=\"Hats\"><option value=\"Baseball Cap\">Baseball Cap</option>\n<option selected=\"selected\" value=\"Cowboy Hat\">Cowboy Hat</option></optgroup>", + grouped_options_for_select([["Hats", ["Baseball Cap","Cowboy Hat"]]], "Cowboy Hat", prompt: true) + ) + end + def test_grouped_options_for_select_returns_html_safe_string assert grouped_options_for_select([["Hats", ["Baseball Cap","Cowboy Hat"]]]).html_safe? end |