How to add "config.include FactoryBot::Syntax::Methods" to rspec config block in spec_helper.rb?

Got it.

This link showed me the way.

The required addition should be made in spec/support/factory_bot.rb and it should look like this:

# RSpec
# spec/support/factory_bot.rb
RSpec.configure do |config|
  config.include FactoryBot::Syntax::Methods
end

Note: FactoryBot was previously called FactoryGirl


You must add this string in file 'spec/RAILS_helper.rb' not in 'spec_helper.rb'


Also make sure to require 'factory_bot' in spec/support/factory_bot.rb

That's what ended up being the issue for me.