Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable unit testing generators in Rails

Does anyone know how to disable the automatic unit test file generation in Rails? Whenever a controller, model or migration is created then it creates the associated files in the test/ directory; I need this disabled.

Also, is it possible to make RPsec take over so that the files are created with RSpec (in the spec/ directory) when a standard rails g model|controller|migration command is performed?

like image 963
matsko Avatar asked Dec 13 '11 23:12

matsko


1 Answers

You want something like this in your application.rb

config.generators do |g|
    g.test_framework  :rspec, :fixture => false
    g.view_specs      false
    g.helper_specs    false
end

More info: http://guides.rubyonrails.org/generators.html#customizing-your-workflow

Personally, I use this one:

config.generators do |g|
    g.orm             :mongoid
    g.template_engine :haml
    g.test_framework  :rspec, :fixture => false
    g.view_specs      false
    g.helper_specs    false
    g.fixture_replacement :fabrication
end
like image 199
Nerian Avatar answered Sep 19 '22 13:09

Nerian