Skip to content

Instantly share code, notes, and snippets.

@vraravam
Last active August 6, 2018 06:53
Show Gist options
  • Save vraravam/82ea00646ecfef96d2aa to your computer and use it in GitHub Desktop.
Save vraravam/82ea00646ecfef96d2aa to your computer and use it in GitHub Desktop.
Configuration at project-level for factory_girl in a rails rspec codebase (spec/support/factory_girl.rb)
# frozen_string_literal: true
RSpec.configure do |config|
config.before(:suite) do
begin
DatabaseCleaner.start
setup_biz
FactoryBot.lint unless config.files_to_run.one?
ensure
DatabaseCleaner.clean
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment