I was to check to see if a text with inline styles exist.
For example page.should have_content(text) works for raw text such as
"Time out",
however it does not work for the text
"Time out. Please <a href=#">Click</a> here to retry".
Also I have been having trouble trying to locate an anchor with inline style as well ex:
<a>click <strong>here</strong>to retry</a>.
Thanks.
You are correct that have_content tests for text, not markup. You can do this though:
Regarding your second question, I don’t think it’s possible to do
page.has_link?with markup. You would have to construct your own XPath expression and then usepage.should have_selector(:xpath, '...'). Or test for the raw HTML usingpage.bodyof course.