I want to test whether some content does not contain any HTML. What is a simple and clean way to do so?
page.find(".description").should_not have_content /\<.*\>/
Does not work properly, since it fails on <strong>Lorem
but passes on <strong>Lorem
. Probably due to the way capybara helps its user with escaping HTML.
Solving with xpaths works, but leaves me wondering if there is not a much simpler solution.
page.should_not have_selector(:xpath, "//div[@class="description"]/*")
Is there a built-in way to detect wether some text has been stripped of HTML in Capybara?