【发布时间】:2019-07-31 17:15:19
【问题描述】:
我有一个要测试的远程表单。
我的功能测试如下所示:
RSpec.feature 'User creates a foobar' do
scenario 'they see the foobar on the page' do
get '/apply', :js
fill_in 'Name', with: 'Joe Bloggs'
click_button 'Submit application'
#...
但是,click_button 'Submit application' 因错误而中断:
*** ActionController::UnknownFormat Exception: ActionController::UnknownFormat
我的控制器只在 JS 中响应。没有重定向/渲染。我想最终检查数据库中是否存在记录。
当响应为js 时,我需要做些什么来确保它不会中断?
【问题讨论】:
标签: ruby-on-rails rspec capybara