我正在编写请求规范,并希望测试字符串"Reports»Aging Reports"的存在.如果我直接在我的matcher表达式中输入字符,我会收到一个错误(无效的多字节字符),所以我尝试了这个:page.should have_content("Reports » Aging Reports")
这使测试失败并显示以下消息:
expected there to be content "Reports » Aging Reports" in "\n Reports » Aging Reports\n
我尝试过.html_safe没有成功的事情.有没有办法测试包含html实体的文本?
编辑:
这是html源代码的相关区域:
<a href="/reports">Reports</a> » <a href="/aging_reports">Aging Reports</a>