【发布时间】:2015-11-11 13:21:51
【问题描述】:
在我的 Rails 控制器中,我有:
def update
render @bill if @bill.update(bill_params)
end
在表单上,我有一个远程 true,因此使用 ajax 将渲染加载到页面上。
但在我的水豚测试中,我有:
fill_in('bill_period', with: @bill.period)
fill_in('bill_groupname', with: @bill.groupname)
click_button 'update bill'
save_and_open_page
页面现在在渲染中打开,而不是应该在其上渲染的页面。它不会仅通过 capybara 在应用程序本身中执行此操作。 如何防止水豚跟随渲染?
【问题讨论】:
标签: ruby-on-rails ajax unit-testing testing capybara