diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-10-25 16:10:31 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-10-25 16:10:31 -0700 |
commit | 0afbe74c3b813f998db94adbed2eaa63e3d62ec1 (patch) | |
tree | 48dfb5c2809ec25ea66adb5c27b56a8314dc2911 /actionview/test | |
parent | 2982b3018dc23cd211dd6f1f7307e343bc55bd3a (diff) | |
parent | d611036c7709d7c30cbab3110e20e248283af364 (diff) | |
download | rails-0afbe74c3b813f998db94adbed2eaa63e3d62ec1.tar.gz rails-0afbe74c3b813f998db94adbed2eaa63e3d62ec1.tar.bz2 rails-0afbe74c3b813f998db94adbed2eaa63e3d62ec1.zip |
Merge pull request #17064 from frenkel/fix_select_tag_include_blank
Use include_blank value as option label
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 2d89332841..4844398c13 100644 --- a/actionview/test/template/form_tag_helper_test.rb +++ b/actionview/test/template/form_tag_helper_test.rb @@ -231,6 +231,12 @@ class FormTagHelperTest < ActionView::TestCase expected = %(<select id="places" name="places"><option value=""></option><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>) + assert_dom_equal expected, actual + end def test_select_tag_with_prompt actual = select_tag "places", "<option>Home</option><option>Work</option><option>Pub</option>".html_safe, :prompt => "string" |