首页 > 解决方案 > 添加 gem 'rails-controller-testing' 的替代方法

问题描述

我正在尝试测试模板是否在请求测试中呈现(通过 Rspec),但我不希望添加 rails-controller-testing gem。还有其他选择吗?

expect(response).to render_template(:index) # add gem 'rails-controller-testing' to your Gemfile first.

标签: rubyrspecrequestruby-on-rails-6

解决方案


推荐阅读