aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorAntonio Tapiador del Dujo <atapiador@dit.upm.es>2012-03-18 11:58:08 +0100
committerAntonio Tapiador del Dujo <atapiador@dit.upm.es>2012-03-18 12:07:51 +0100
commit05406442b81be49154737d763fc65c7fb0f03608 (patch)
tree19e1b66bb872556c7267a6101cfe1de7f3d70722 /actionpack/test
parent2b5cb1cd41ea765ae665321236c83c9d0128636b (diff)
downloadrails-05406442b81be49154737d763fc65c7fb0f03608.tar.gz
rails-05406442b81be49154737d763fc65c7fb0f03608.tar.bz2
rails-05406442b81be49154737d763fc65c7fb0f03608.zip
time_tag support for blocks
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/date_helper_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/test/template/date_helper_test.rb b/actionpack/test/template/date_helper_test.rb
index 9e2f4ec347..1d934b153f 100644
--- a/actionpack/test/template/date_helper_test.rb
+++ b/actionpack/test/template/date_helper_test.rb
@@ -2865,6 +2865,10 @@ class DateHelperTest < ActionView::TestCase
assert_match(/<time.*>Right now<\/time>/, time_tag(Time.now, 'Right now'))
end
+ def test_time_tag_with_given_block
+ assert_match(/<time.*><span>Right now<\/span><\/time>/, time_tag(Time.now){ '<span>Right now</span>'.html_safe })
+ end
+
def test_time_tag_with_different_format
time = Time.now
expected = "<time datetime=\"#{time.xmlschema}\">#{I18n.l(time, :format => :short)}</time>"