From f71b075d6c29447d08193007936f6376779d7bff Mon Sep 17 00:00:00 2001 From: sanemat Date: Sun, 7 Jul 2013 23:14:34 +0900 Subject: Fix link_to with block and url_hash Use link_to with block and url_hash, expect block as name. But ignore block and use url_hash as name. 3-2-stable passes this test. 4-0-stable and master fail this. --- actionview/test/template/url_helper_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actionview/test/template') diff --git a/actionview/test/template/url_helper_test.rb b/actionview/test/template/url_helper_test.rb index 54747fe079..851ea8796f 100644 --- a/actionview/test/template/url_helper_test.rb +++ b/actionview/test/template/url_helper_test.rb @@ -308,6 +308,13 @@ class UrlHelperTest < ActiveSupport::TestCase link_to('/', class: "special") { content_tag(:span, 'Example site') } end + def test_link_tag_using_block_and_hash + assert_dom_equal( + %{Example site}, + link_to(url_hash) { content_tag(:span, 'Example site') } + ) + end + def test_link_tag_using_block_in_erb out = render_erb %{<%= link_to('/') do %>Example site<% end %>} assert_equal 'Example site', out -- cgit v1.2.3