From 3907996b9d43c64155531edd26e1add37ecd84e6 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Fri, 27 Aug 2010 15:30:22 -0300 Subject: [PATCH] Add test to show double render error using with options and erb blocks --- actionpack/test/template/erb/form_for_test.rb | 2 +- actionpack/test/template/erb/tag_helper_test.rb | 4 ---- actionpack/test/template/erb/with_options_test.rb | 16 ++++++++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 actionpack/test/template/erb/with_options_test.rb diff --git a/actionpack/test/template/erb/form_for_test.rb b/actionpack/test/template/erb/form_for_test.rb index e722b40..aed5a2e 100644 --- a/actionpack/test/template/erb/form_for_test.rb +++ b/actionpack/test/template/erb/form_for_test.rb @@ -2,7 +2,7 @@ require "abstract_unit" require "template/erb/helper" module ERBTest - class TagHelperTest < BlockTestCase + class FormForTest < BlockTestCase test "form_for works" do output = render_content "form_for(:staticpage, :url => {:controller => 'blah', :action => 'update'})", "" assert_match %r{.*}, output diff --git a/actionpack/test/template/erb/tag_helper_test.rb b/actionpack/test/template/erb/tag_helper_test.rb index d073100..83d1bee 100644 --- a/actionpack/test/template/erb/tag_helper_test.rb +++ b/actionpack/test/template/erb/tag_helper_test.rb @@ -39,10 +39,6 @@ module ERBTest end class TagHelperTest < BlockTestCase - def block_helper(str, rest) - "<%= #{str} do %>#{rest}<% end %>" - end - include SharedTagHelpers end diff --git a/actionpack/test/template/erb/with_options_test.rb b/actionpack/test/template/erb/with_options_test.rb new file mode 100644 index 0000000..4e805b6 --- /dev/null +++ b/actionpack/test/template/erb/with_options_test.rb @@ -0,0 +1,16 @@ +require "abstract_unit" +require "template/erb/helper" + +module ERBTest + class WithOptionsTest < BlockTestCase + test "with_options works" do + output = render_content "with_options :size => 10", "<%= opt.text_field_tag 'hello', 'world' %>" + expected = '' + assert_equal expected, output + end + + def block_helper(str, rest) + "<%= #{str} do |opt| %>#{rest}<% end %>" + end + end +end \ No newline at end of file -- 1.7.2