From ba52748d05da4f95a8f371d628af97b76644bdd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sun, 29 Aug 2010 21:08:14 -0300 Subject: Remove deprecated support to <% form_for %> and several ActionController::Base methods. --- actionpack/test/template/erb/tag_helper_test.rb | 44 ++++++------------------- 1 file changed, 10 insertions(+), 34 deletions(-) (limited to 'actionpack/test/template/erb/tag_helper_test.rb') diff --git a/actionpack/test/template/erb/tag_helper_test.rb b/actionpack/test/template/erb/tag_helper_test.rb index d073100986..036f3a3cc9 100644 --- a/actionpack/test/template/erb/tag_helper_test.rb +++ b/actionpack/test/template/erb/tag_helper_test.rb @@ -2,59 +2,35 @@ require "abstract_unit" require "template/erb/helper" module ERBTest - module SharedTagHelpers - extend ActiveSupport::Testing::Declarative - - def maybe_deprecated - if @deprecated - assert_deprecated { yield } - else - yield - end + class TagHelperTest < BlockTestCase + def block_helper(str, rest) + "<%= #{str} do %>#{rest}<% end %>" end + extend ActiveSupport::Testing::Declarative + test "percent equals works for content_tag and does not require parenthesis on method call" do - maybe_deprecated { assert_equal "
Hello world
", render_content("content_tag :div", "Hello world") } + assert_equal "
Hello world
", render_content("content_tag :div", "Hello world") end test "percent equals works for javascript_tag" do expected_output = "" - maybe_deprecated { assert_equal expected_output, render_content("javascript_tag", "alert('Hello')") } + assert_equal expected_output, render_content("javascript_tag", "alert('Hello')") end test "percent equals works for javascript_tag with options" do expected_output = "" - maybe_deprecated { assert_equal expected_output, render_content("javascript_tag(:id => 'the_js_tag')", "alert('Hello')") } + assert_equal expected_output, render_content("javascript_tag(:id => 'the_js_tag')", "alert('Hello')") end test "percent equals works with form tags" do expected_output = %r{.*hello*} - maybe_deprecated { assert_match expected_output, render_content("form_tag('foo')", "<%= 'hello' %>") } + assert_match expected_output, render_content("form_tag('foo')", "<%= 'hello' %>") end test "percent equals works with fieldset tags" do expected_output = "
foohello
" - maybe_deprecated { assert_equal expected_output, render_content("field_set_tag('foo')", "<%= 'hello' %>") } + assert_equal expected_output, render_content("field_set_tag('foo')", "<%= 'hello' %>") end end - - class TagHelperTest < BlockTestCase - def block_helper(str, rest) - "<%= #{str} do %>#{rest}<% end %>" - end - - include SharedTagHelpers - end - - class DeprecatedTagHelperTest < BlockTestCase - def block_helper(str, rest) - "<% __in_erb_template=true %><% #{str} do %>#{rest}<% end %>" - end - - def setup - @deprecated = true - end - - include SharedTagHelpers - end end \ No newline at end of file -- cgit v1.2.3