Skip to content

Instantly share code, notes, and snippets.

@thaleshcv
Last active April 30, 2021 19:07
Show Gist options
  • Save thaleshcv/fe8a5ddabdaf27cb742038d133fc5709 to your computer and use it in GitHub Desktop.
Save thaleshcv/fe8a5ddabdaf27cb742038d133fc5709 to your computer and use it in GitHub Desktop.
# spec/support/factory_bot.rb
RSpec.configure do |config|
config.include FactoryBot::Syntax::Methods
end
# spec/support/database_cleaner.rb
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
config.around(:each) do |example|
DatabaseCleaner.cleaning do
example.run
end
end
end
# spec/support/devise.rb
RSpec.configure do |config|
config.include Warden::Test::Helpers
end
RSpec.configure do |config|
config.after :each do
Warden.test_reset!
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment