diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-03-07 20:58:54 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-03-07 20:58:54 +0000 |
commit | 67b17d029a8eeddd908cce2d4e0e27e4708e8463 (patch) | |
tree | 4cd589411104f7222835dd5012f4bb7743e1d215 /actionpack/test/template/form_options_helper_test.rb | |
parent | bb063b2f1b3e5b6fb2a4732cb696929f1652c555 (diff) | |
parent | 5968d7a65886d3450698889f685eccaf54749f43 (diff) | |
download | rails-67b17d029a8eeddd908cce2d4e0e27e4708e8463.tar.gz rails-67b17d029a8eeddd908cce2d4e0e27e4708e8463.tar.bz2 rails-67b17d029a8eeddd908cce2d4e0e27e4708e8463.zip |
Merge branch 'master' into nested_has_many_through
Diffstat (limited to 'actionpack/test/template/form_options_helper_test.rb')
-rw-r--r-- | actionpack/test/template/form_options_helper_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionpack/test/template/form_options_helper_test.rb index 69b1d4ff7b..93ff7ba0fd 100644 --- a/actionpack/test/template/form_options_helper_test.rb +++ b/actionpack/test/template/form_options_helper_test.rb @@ -1,6 +1,12 @@ require 'abstract_unit' require 'tzinfo' +class Map < Hash + def category + "<mus>" + end +end + TZInfo::Timezone.cattr_reader :loaded_zones class FormOptionsHelperTest < ActionView::TestCase @@ -394,6 +400,19 @@ class FormOptionsHelperTest < ActionView::TestCase ) end + def test_fields_for_with_record_inherited_from_hash + map = Map.new + + output_buffer = fields_for :map, map do |f| + concat f.select(:category, %w( abe <mus> hest)) + end + + assert_dom_equal( + "<select id=\"map_category\" name=\"map[category]\"><option value=\"abe\">abe</option>\n<option value=\"<mus>\" selected=\"selected\"><mus></option>\n<option value=\"hest\">hest</option></select>", + output_buffer + ) + end + def test_select_under_fields_for_with_index @post = Post.new @post.category = "<mus>" |