禁用请求和路由规范的生成? [RS规格]
每当我生成脚手架时,Rspec 生成器总是创建如下所示的规范:
invoke rspec
create spec/controllers/stars_controller_spec.rb
invoke helper
create spec/routing/stars_routing_spec.rb
invoke rspec
create spec/requests/stars_spec.rb
如何确保这些规范永远不会生成?我尝试像这样设置配置设置,但没有帮助:
config.generators do |g|
g.test_framework :rspec, :fixture => true, :views => false
g.view_specs false
g.integration_specs false
g.helper_specs false
end
Whenever I generate a scaffold, Rspec generator always creates specs like the following:
invoke rspec
create spec/controllers/stars_controller_spec.rb
invoke helper
create spec/routing/stars_routing_spec.rb
invoke rspec
create spec/requests/stars_spec.rb
How can I make sure that these are never generated? I tried setting configuration settings like this, but it didn't help:
config.generators do |g|
g.test_framework :rspec, :fixture => true, :views => false
g.view_specs false
g.integration_specs false
g.helper_specs false
end
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ps - 查看文档了解更多信息。
ps - see the docs for more info.
如何找到这些选项?
文档可能已过时。但是,可以在 RSpec Rails 库中找到选项列表。
How can you find these options?
Documentation can be out of date. However, the list of options can be found in RSpec Rails library.