我正在重新运行ROR4上的Hartl ROR3教程
我注意到即使添加了rspec ......
rails generate rspec:install
...当我创建控制器时,我没有看到rspec调用...
>rails generate controller Pages home contact
create app/controllers/pages_controller.rb
route get "pages/contact"
route get "pages/home"
invoke erb
create app/views/pages
create app/views/pages/home.html.erb
create app/views/pages/contact.html.erb
invoke helper
create app/helpers/pages_helper.rb
invoke assets
invoke coffee
create app/assets/javascripts/pages.js.coffee
invoke scss
create app/assets/stylesheets/pages.css.scss
ROR4如何处理自动生成rspec,或者它是什么?
答案 0 :(得分:0)
根据rails g controller
生成的帮助文档中的以下部分,在ROR 4上自动生成控制器规范默认为true,就像在ROR 3上一样:
Rspec options:
[--controller-specs] # Indicates when to generate controller specs
# Default: true
[--view-specs] # Indicates when to generate view specs
# Default: true
您是否已将Rails配置为使用默认值以外的其他内容?