everydayrails / everydayrails-rspec-2017

Sample source for the 2017 edition of Everyday Rails Testing with RSpec.
http://rspectutorial.com
312 stars 247 forks source link

Chapter 4, Remove `request_specs: false` #102

Open JunichiIto opened 5 years ago

JunichiIto commented 5 years ago

Chapter 4, the section "Installing Factory Bot", you wrote config/application.rb like this:

    config.generators do |g|
      g.test_framework :rspec,
        view_specs: false,
        helper_specs: false,
        routing_specs: false,
        request_specs: false
    end

However, the line request_specs: false does not exist in the sample code:

https://github.com/everydayrails/everydayrails-rspec-2017/blob/04-factories/config/application.rb#L18-L23

This line is harmful because it prevents from generating request specs. For example, if you execute the command bin/rails g rspec:request projects_api in Chapter 7, it generates nothing without any errors:

$ bin/rails g rspec:request projects_api
Running via Spring preloader in process 97985
$

This behavior is very confusing for the readers. Actually, one of them was in trouble:

https://twitter.com/diveintoganges/status/1049634233184968704

Therefore, I think the line request_specs: false should be removed.