aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/form_options_helper_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/template/form_options_helper_test.rb')
-rw-r--r--actionpack/test/template/form_options_helper_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionpack/test/template/form_options_helper_test.rb
index a94f81a728..962d0c5069 100644
--- a/actionpack/test/template/form_options_helper_test.rb
+++ b/actionpack/test/template/form_options_helper_test.rb
@@ -94,6 +94,17 @@ class FormOptionsHelperTest < Test::Unit::TestCase
)
end
+ def test_array_options_for_string_include_in_other_string_bug_fix
+ assert_equal(
+ "<option>ruby</option>\n<option selected=\"selected\">rubyonrails</option>",
+ options_for_select([ "ruby", "rubyonrails" ], "rubyonrails")
+ )
+ assert_equal(
+ "<option selected=\"selected\">ruby</option>\n<option>rubyonrails</option>",
+ options_for_select([ "ruby", "rubyonrails" ], "ruby")
+ )
+ end
+
def test_hash_options_for_select
assert_equal(
"<option value=\"&lt;Kroner&gt;\">&lt;DKR&gt;</option>\n<option value=\"Dollar\">$</option>",