Skip to content

Instantly share code, notes, and snippets.

@apotonick
Created December 30, 2010 21:49
Show Gist options
  • Save apotonick/760353 to your computer and use it in GitHub Desktop.
Save apotonick/760353 to your computer and use it in GitHub Desktop.
AV::ViewHelper replacement.rb
# from tag_helper_test.rb
# now:
# TAG TODO: Move this into a real template
def test_content_tag_nested_in_content_tag_in_erb
buffer = content_tag("p") { concat content_tag("b", "Hello") }
assert_equal '<p><b>Hello</b></p>', buffer
end
# better:
# TAG TODO: Move this into a real template
def test_content_tag_nested_in_content_tag_in_erb
buffer = in_view do content_tag("p") { concat content_tag("b", "Hello") } end
assert_equal '<p><b>Hello</b></p>', buffer
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment