Do not generate test automatically in Rails

I use rspec with Rails 4 and when creating controllers, for example, I always need to pass the parameter - no-test-framework . Is there a way not to generate these tests by default without having to explicitly specify it (I often forget, and then I need to manually delete the generated tests).

Thanks!

+8
ruby-on-rails unit-testing
source share
2 answers

Just add the following to config/application.rb (in the Application class):

 config.generators.test_framework false 
+18
source share

You can add the following to config/application.rb to prevent the creation of specific specifications:

 config.generators do |g| g.controller_specs false g.view_specs false g.helper_specs false g.model_specs false end 
+4
source share

All Articles