Rspec :: Additions
1.
Uncomment following line from rails_helper.rb so all files inside spec/support are loaded automatically by rspec
# Dir[Rails.root.join('spec', 'support', '**', '*.rb')].sort.each { |f| require f }
Dir[Rails.root.join('spec', 'support', '**', '*.rb')].sort.each { |f| require f }2.
Check factory bot rails version inside Gemfile.lock and update the gem with that version in
Gemfile. It was6.1.0while writing this tutorial, yours may be different depending on latest gem version.group :development, :test do gem 'factory_bot_rails', '~> 6.1.0' end
3.- Add factories folder inside
spec folder if it doesn’t already exist. You can then create factories inside spec/factories folder.
Comments
Post a Comment