ilovebigmacs
ilovebigmacs

Reputation: 993

Don't generate test automatically in Rails

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

Thank you!

Upvotes: 9

Views: 2472

Answers (2)

Gray
Gray

Reputation: 677

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

config.generators.test_framework false

Upvotes: 20

user2062950
user2062950

Reputation:

You can add the following to config/application.rb to prevent specific specs from generating:

config.generators do |g|
  g.controller_specs false 
  g.view_specs false
  g.helper_specs false
  g.model_specs false
end

Upvotes: 4

Related Questions