我有以下 HTML 片段,我assert_select
的不再工作(升级到最新版本的 Rails 后):
<div id="content">
<div class="container">
<div class="foo">
<h2><a href="/downloads/latest.zip">Latest</a></h2>
<p>
<a href="/downloads/latest.zip" class="button download">
<span>Download</span>
</a>
</p>
</div>
</div>
</div>
这是断言:
assert_select '.container a.downloadbutton[href^=/downloads]', assigns(:downloads).count
这是错误:
Expected exactly 1 element matching ".container a.button[href^='/downloads']", found 0.
有人知道我在做什么错吗?
谢谢!!!五