From 7b73913701ff41981d166ca457e41690aac3bce3 Mon Sep 17 00:00:00 2001 From: Sergey Nartimov Date: Mon, 20 Feb 2012 15:41:17 -0800 Subject: fix output safety issue with select options --- actionpack/test/template/form_options_helper_test.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionpack/test/template/form_options_helper_test.rb index 62ab208c2e..5b19bcf0f9 100644 --- a/actionpack/test/template/form_options_helper_test.rb +++ b/actionpack/test/template/form_options_helper_test.rb @@ -495,7 +495,7 @@ class FormOptionsHelperTest < ActionView::TestCase def test_select_under_fields_for_with_string_and_given_prompt @post = Post.new - options = "" + options = "".html_safe output_buffer = fields_for :post, @post do |f| concat f.select(:category, options, :prompt => 'The prompt') @@ -651,6 +651,13 @@ class FormOptionsHelperTest < ActionView::TestCase ) end + def test_select_escapes_options + assert_dom_equal( + '', + select('post', 'title', '') + ) + end + def test_select_with_selected_nil @post = Post.new @post.category = "" -- cgit v1.2.3