Disable unit testing generators in Rails

前端 未结 1 1361
北荒
北荒 2020-12-13 02:51

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 i

相关标签:
1条回答
  • 2020-12-13 03:28

    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
    
    0 讨论(0)
提交回复
热议问题