Created
August 22, 2014 12:55
-
-
Save wkrsz/ed2407a0c131e094a333 to your computer and use it in GitHub Desktop.
assert_select to test helper output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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