diff options
author | Vipul A M <vipulnsward@gmail.com> | 2016-06-28 14:22:42 -0700 |
---|---|---|
committer | Vipul A M <vipulnsward@gmail.com> | 2016-06-28 18:27:14 -0700 |
commit | 4582a3661724c2cda55a8f8ac53f37686ca72927 (patch) | |
tree | 83e883725da0bcb85601dd5acb25e94882c7d278 /actionview/test | |
parent | af874cc57fd32e7d37beebe1a82072594504057e (diff) | |
download | rails-4582a3661724c2cda55a8f8ac53f37686ca72927.tar.gz rails-4582a3661724c2cda55a8f8ac53f37686ca72927.tar.bz2 rails-4582a3661724c2cda55a8f8ac53f37686ca72927.zip |
- Added select tag test for verifying passing html options to f.select helper
- Renamed test to be more descriptive
Diffstat (limited to 'actionview/test')
-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" |