From 8190bce8bc7249b7b9f3680195336eb3ca9508ee Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 17 Jun 2008 14:01:37 -0500 Subject: Added block-call style to link_to [Sam Stephenson/DHH] --- actionpack/test/template/url_helper_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index d45ea08a6f..0713cea8ac 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -211,6 +211,14 @@ class UrlHelperTest < ActionView::TestCase def test_link_tag_using_post_javascript_and_popup assert_raises(ActionView::ActionViewError) { link_to("Hello", "http://www.example.com", :popup => true, :method => :post, :confirm => "Are you serious?") } end + + def test_link_tag_using_block + self.output_buffer = '' + + link_to("http://example.com") { concat("Example site") } + + assert_equal 'Example site', output_buffer + end def test_link_to_unless assert_equal "Showing", link_to_unless(true, "Showing", :action => "show", :controller => "weblog") -- cgit v1.2.3