user882223 user882223 - 1 year ago 149
Ruby Question

configuring rspec-rails generators

I want to configure rpsec-rails generators so that I can for example disable view and controller tests or manually replace fixtures with factories. I read the documentation, blog posts and ask questions on rspec IRC channel, but I found no good answer. suppose I want to disable the view specs. I should do something like:

config.generators do |g|
g.test_framework :rspec,
views: false

My question is where can I find list of all available option like 'views'?

Answer Source

Here is the list of all options which I know for Rspec:

config.generators do |generate|
  generate.test_framework  :rspec,
        fixtures: true,
        view_specs: false,
        helper_specs: false,
        routing_specs: false,
        controller_specs: false,
        request_specs: false
   generate.fixture_replacement :factory_girl, dir: "spec/factories"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download