Can't test for html or body tags
Closed this issue · 3 comments
getaaron commented
This test passes, but it should fail:
describe "index" do
it "does something weird" do
expect("<h1>just a header</h1>").to have_tag("html")
end
end
The same behavior exists with have_tag("body")
.
I think it's because of this line, which passes the string straight into Nokogiri::HTML
.
Two questions:
- Is there a workaround where I can test for
html
andbody
tags? - If not, should
have_tag
raise an exception when it's passed these tags so developers know not to rely on them?
randoum commented