From dff73dec223c5d4ffe1178e0e15399f78d962e76 Mon Sep 17 00:00:00 2001 From: Diego Carrion Date: Sun, 6 Mar 2011 00:47:15 -0300 Subject: added failing test for fields_for with a record object that inherits from Hash Signed-off-by: Andrew White --- actionpack/test/template/form_options_helper_test.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'actionpack/test/template/form_options_helper_test.rb') 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 + "" + 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 hest)) + end + + assert_dom_equal( + "", + output_buffer + ) + end + def test_select_under_fields_for_with_index @post = Post.new @post.category = "" -- cgit v1.2.3