我有一个简单的选择标记:
<strong>Choose: </strong><%= select_tag(:topic_id, options_for_select([
['Choose','#'],
['Schools',schools_path],
['Spells', spells_path],
['Traits', traits_path],
['Clans', clans_path],
['Skills', skills_path]])) %>
我有一个coffeescript重定向器:
$(document).on 'change','#topic_id', ->
window.location.replace($(this).val())
手工一切都很好但是当我尝试用水豚来测试时,它会在选择之后暂停重定向。
feature "legend school page" do
background do
visit legend_path
select('Schools', from: 'topic_id' )
end
scenario "it should have right topic" do
expect(page).to have_title "Schools"
end
从我所读到的资本应该使用jy,它应该像这样工作。但我刚开始学习,所以我可能错了。