diff options
author | Guo Xiang Tan <tgx_world@hotmail.com> | 2014-11-21 17:44:24 +0800 |
---|---|---|
committer | Guo Xiang Tan <tgx_world@hotmail.com> | 2014-11-21 17:44:24 +0800 |
commit | e0e9d5bd8600c01de6b73487bf66046d179c0ed7 (patch) | |
tree | 6cb00db7baab9e3d2e462373a73dcc9fa38e552d /actionview/test | |
parent | 8ffc8da71360f0defcc4ac44d25c1732b3f73820 (diff) | |
download | rails-e0e9d5bd8600c01de6b73487bf66046d179c0ed7.tar.gz rails-e0e9d5bd8600c01de6b73487bf66046d179c0ed7.tar.bz2 rails-e0e9d5bd8600c01de6b73487bf66046d179c0ed7.zip |
Fix select_tag generating tag when set to false.
Fixes https://github.com/rails/rails/issues/17701.
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/form_tag_helper_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/actionview/test/template/form_tag_helper_test.rb b/actionview/test/template/form_tag_helper_test.rb index f8fd642809..84a581b107 100644 --- a/actionview/test/template/form_tag_helper_test.rb +++ b/actionview/test/template/form_tag_helper_test.rb @@ -232,6 +232,12 @@ class FormTagHelperTest < ActionView::TestCase assert_dom_equal expected, actual end + def test_select_tag_with_include_blank_false + actual = select_tag "places", "<option>Home</option><option>Work</option><option>Pub</option>".html_safe, include_blank: false + expected = %(<select id="places" name="places"><option>Home</option><option>Work</option><option>Pub</option></select>) + assert_dom_equal expected, actual + end + def test_select_tag_with_include_blank_string actual = select_tag "places", "<option>Home</option><option>Work</option><option>Pub</option>".html_safe, include_blank: 'Choose' expected = %(<select id="places" name="places"><option value="">Choose</option><option>Home</option><option>Work</option><option>Pub</option></select>) |