aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-07-07 10:02:39 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-07-07 10:02:39 -0700
commit9eeb3cc040f9ab701279d73aa76f12737cedd3fb (patch)
tree012ccc88de0df14f5df33c1c5ead488bf3702e40 /actionview/test/template
parent09f6fe1cd4099837c5801fe654804ae058c211b4 (diff)
parentbcc30d8f2fc50ff096fd045cf9e507ce547a739d (diff)
downloadrails-9eeb3cc040f9ab701279d73aa76f12737cedd3fb.tar.gz
rails-9eeb3cc040f9ab701279d73aa76f12737cedd3fb.tar.bz2
rails-9eeb3cc040f9ab701279d73aa76f12737cedd3fb.zip
Merge pull request #11348 from sanemat/fix/link-to-block
Fix actionview link_to with block and url_hash
Diffstat (limited to 'actionview/test/template')
-rw-r--r--actionview/test/template/url_helper_test.rb7
1 files changed, 7 insertions, 0 deletions
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(
+ %{<a href="/"><span>Example site</span></a>},
+ 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 '<a href="/">Example site</a>', out