我想为我的一个视图中呈现的img
标签中src
属性的一部分值进行规范化,我希望使用以下语法:
is_expected.to have_tag 'img', with: {src: /thumb_product\.png/}
它不起作用,这很奇怪,因为表达式似乎被nokogiri正确解释了(请参见(?-mix:...)
标准)
expected following:
<div class='active uploaded_image'>
<img alt="Thumb product" src="/uploads/tmp/1404970363-22080-9933/thumb_product.png" />
</div>
to have at least 1 element matching "img[src='(?-mix:thumb_product\.png)']", found 0.
所以我想知道是不是我忘记了什么,或者它根本不可能。提前感谢。