aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/tag_helper_test.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/actionpack/test/template/tag_helper_test.rb b/actionpack/test/template/tag_helper_test.rb
index bda57c4e9b..0ebdf009c7 100644
--- a/actionpack/test/template/tag_helper_test.rb
+++ b/actionpack/test/template/tag_helper_test.rb
@@ -1,11 +1,10 @@
require File.dirname(__FILE__) + '/../abstract_unit'
-require File.dirname(__FILE__) + '/../../lib/action_view/helpers/tag_helper'
-require File.dirname(__FILE__) + '/../../lib/action_view/helpers/url_helper'
-
class TagHelperTest < Test::Unit::TestCase
include ActionView::Helpers::TagHelper
include ActionView::Helpers::UrlHelper
+ include ActionView::Helpers::TextHelper
+ include ActionView::Helpers::CaptureHelper
def test_tag
assert_equal "<p class=\"show\" />", tag("p", "class" => "show")
@@ -35,6 +34,18 @@ class TagHelperTest < Test::Unit::TestCase
content_tag("a", "Create", :href => "create")
end
+ def test_content_tag_with_block
+ _erbout = ''
+ content_tag(:div) { _erbout.concat "Hello world!" }
+ assert_dom_equal "<div>Hello world!</div>", _erbout
+ end
+
+ def test_content_tag_with_block_and_options
+ _erbout = ''
+ content_tag(:div, :class => "green") { _erbout.concat "Hello world!" }
+ assert_dom_equal %(<div class="green">Hello world!</div>), _erbout
+ end
+
def test_cdata_section
assert_equal "<![CDATA[<hello world>]]>", cdata_section("<hello world>")
end