Rspec testing for html entities in page content

后端 未结 4 859
我寻月下人不归
我寻月下人不归 2021-02-19 06:19

I\'m writing a request spec and would like to test for the presence of the string \"Reports » Aging Reports\". I get an error (invalid multibyte char) if I put in the character

4条回答
  •  醉话见心
    2021-02-19 07:05

    I found a workaround for the time being that uses a regex instead of a string:

    find('#breadcrumbs').text.should match(/Reports . Aging Reports/)

    This gets the text of the breadcrumbs div, which contains the text I'm looking for, so the scope of the match is limited. This works fine, but I'd still love to know how to match specific html entities.

提交回复
热议问题