diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-06-17 14:01:37 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-06-17 17:37:29 -0500 |
commit | 8190bce8bc7249b7b9f3680195336eb3ca9508ee (patch) | |
tree | f159b343e4893f08da5f9a3d92e1c88783323a83 /actionpack/test | |
parent | 22af62cf486721ee2e45bb720c42ac2f4121faf4 (diff) | |
download | rails-8190bce8bc7249b7b9f3680195336eb3ca9508ee.tar.gz rails-8190bce8bc7249b7b9f3680195336eb3ca9508ee.tar.bz2 rails-8190bce8bc7249b7b9f3680195336eb3ca9508ee.zip |
Added block-call style to link_to [Sam Stephenson/DHH]
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/url_helper_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
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 '<a href="http://example.com">Example site</a>', output_buffer + end def test_link_to_unless assert_equal "Showing", link_to_unless(true, "Showing", :action => "show", :controller => "weblog") |