Last active
April 30, 2021 19:07
-
-
Save thaleshcv/fe8a5ddabdaf27cb742038d133fc5709 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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