Search code examples
ruby-on-railsrspecgenerator

Disable generation of requests and routing specs? [RSPEC]


Whenever I generate a scaffold, Rspec generator always creates specs like the following:

  invoke    rspec
  create      spec/controllers/stars_controller_spec.rb
  invoke      helper
  create      spec/routing/stars_routing_spec.rb
  invoke      rspec
  create        spec/requests/stars_spec.rb

How can I make sure that these are never generated? I tried setting configuration settings like this, but it didn't help:

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

Solution

  • config.generators do |g|
      g.test_framework :rspec,
        :view_specs    => false,
        :request_specs => false,
        :routing_specs => false
    end
    

    ps - see the docs for more info.