【发布时间】:2014-06-26 14:21:10
【问题描述】:
这是我测试中的代码:
assert_select "a[href=?]", "/path/with?params", { :count => 1, :text => "" }
这是我收到的失败消息:
Expected exactly 1 element matching "a[href='/path/with?params']", found 0..
Expected: 0
Actual: 1
有什么线索吗?它期待 0 还是 1,它找到 1 还是 0?
更新:对于所有来这里搜索如何做我想做的事情的人,我最终这样做了:
assert_match(/<a href="/path/with?params">/, response.body)
【问题讨论】:
标签: ruby assert minitest assertions assertion