如果我有这个HTML:
<select name"bo">
<option value="yo">Yo</option>
<option value="ho">Ho</option>
<option value="go">Go</option>
</select>
我可以使用什么步骤定义Capybara利用Poltergeist在此步骤中进行失败的测试:
Then Select "bo" does not contain the "yo" option
答案 0 :(得分:1)
我想我理解你的问题。你可以这样做:
it "doesn't find element" do
visit whatever_path
expect { select "NotARealOption", from: "bo" }.to raise_error(SomeCapybaraError, "no match found")
end