mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Add assertion to link_to_function test with block and capture, and more expressive test name [#5179 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
committed by
José Valim
parent
92669b8320
commit
751f89b8b2
@@ -89,14 +89,13 @@ class JavaScriptHelperTest < ActionView::TestCase
|
||||
link_to_function("Greeting", "alert('Hello world!')", :href => 'http://example.com/')
|
||||
end
|
||||
|
||||
def test_link_to_function_with_inner_block
|
||||
def test_link_to_function_with_inner_block_does_not_raise_exception
|
||||
html = link_to_function("Greet me!") do |page|
|
||||
content_tag :h1 do
|
||||
'Hi'
|
||||
end
|
||||
content_tag(:h1) { 'Hi' }
|
||||
end
|
||||
end
|
||||
|
||||
assert_dom_equal %(<a href='#' onclick="; return false;">Greet me!</a>), html
|
||||
end
|
||||
|
||||
def test_javascript_tag
|
||||
self.output_buffer = 'foo'
|
||||
|
||||
Reference in New Issue
Block a user