From 16d32075fbd797e0dbebd68b9266c7c053073798 Mon Sep 17 00:00:00 2001 From: Ivan Torres Date: Wed, 14 Jul 2010 01:23:41 -0500 Subject: [PATCH] select :include_blank or :prompt should return escaped string [#5099 state:resolved] --- .../lib/action_view/helpers/form_options_helper.rb | 6 ++-- .../test/template/form_options_helper_test.rb | 23 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index 6f9d14d..ee34452 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -447,7 +447,7 @@ module ActionView # wrap the output in an appropriate \n\n\n", + select("post", "category", %w( abe hest), :include_blank => '') + ) + end + def test_select_with_default_prompt @post = Post.new @post.category = "" @@ -394,6 +409,14 @@ class FormOptionsHelperTest < ActionView::TestCase ) end + def test_select_with_given_prompt_escaped + @post = Post.new + assert_dom_equal( + "", + select("post", "category", %w( abe hest), :prompt => '') + ) + end + def test_select_with_prompt_and_blank @post = Post.new @post.category = "" -- 1.7.1