的內部類的名字我旁邊的html代碼:Rspec的2 - 標籤
<ul class="nav">
<li class="active">
<a href="https://stackoverflow.com/users/page">Page</a>
</li>
...
</ul>
我想確保我有L1標籤帶班「活動」,而該文本的內部。
所以,我試過了:
response.should have_selector("li", :class => "active" ,:content => "Page")
而且它不工作,我得到這樣的錯誤:
Failure/Error: response.should have_selector("li", :class => "active" ,:content => "Page")
expected following output to contain a <li class='active'>Page</li> tag:
我怎麼能解決我的問題?