Permalink
Browse files

Add assertion to link_to_function test with block and capture, and mo…

…re expressive test name [#5179 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent 92669b8 commit 751f89b8b28634cb237d1e47f33ddefaa13829dc @carlosantoniodasilva carlosantoniodasilva committed with josevalim Jul 25, 2010
Showing with 4 additions and 5 deletions.
  1. +4 −5 actionpack/test/template/javascript_helper_test.rb
@@ -89,14 +89,13 @@ def test_link_to_function_with_href
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'

0 comments on commit 751f89b

Please sign in to comment.