diff options
-rw-r--r-- | actionview/test/template/form_options_helper_test.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/actionview/test/template/form_options_helper_test.rb b/actionview/test/template/form_options_helper_test.rb index 7a5904f151..a85f2da264 100644 --- a/actionview/test/template/form_options_helper_test.rb +++ b/actionview/test/template/form_options_helper_test.rb @@ -738,7 +738,7 @@ class FormOptionsHelperTest < ActionView::TestCase ) end - def test_empty + def test_select_with_empty @post = Post.new @post.category = "" assert_dom_equal( @@ -747,6 +747,15 @@ class FormOptionsHelperTest < ActionView::TestCase ) end + def test_select_with_html_options + @post = Post.new + @post.category = "" + assert_dom_equal( + "<select class=\"disabled\" disabled=\"disabled\" name=\"post[category]\" id=\"post_category\"><option value=\"\">Please select</option>\n<option value=\"\"></option>\n</select>", + select("post", "category", [], { prompt: true, include_blank: true }, { class: 'disabled', disabled: true }) + ) + end + def test_select_with_nil @post = Post.new @post.category = "othervalue" |