我在一个新的 rails 项目上安装了 simplecov,但它没有检查视图文件。在阅读了有关此问题的其他一些帖子后,我将我的应用程序更新如下,但没有骰子。我如何让 simplecov 也测试我的观点?
规范/spec_helper.rb
require 'simplecov'
SimpleCov.start do
add_filter "/spec/"
add_filter "/config/"
add_group "Models", "app/models"
add_group "Controllers", "app/controllers"
add_group "Views", "app/views"
# TODO: why isn't SimpleCov showing my view files?
end
...
配置/环境/test.rb
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Do not eager load code on boot. This avoids loading your whole application
# just for the purpose of running a single test. If you are using a tool that
# preloads Rails for running tests, you may have to set it to true.
config.eager_load = true
...