Skip to content

Instantly share code, notes, and snippets.

@wkrsz
Created August 22, 2014 12:55
Show Gist options
  • Save wkrsz/ed2407a0c131e094a333 to your computer and use it in GitHub Desktop.
Save wkrsz/ed2407a0c131e094a333 to your computer and use it in GitHub Desktop.
assert_select to test helper output
class ExampleTest < ActionView::TestCase
test "example" do
helper_output = "<p class='error'>Yo!</p>"
parsed = HTML::Document.new(helper_output).root
assert_select parsed, "p.error"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment