Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RSpec.configure do |config|
- current_db = Rails.configuration.database_configuration[Rails.env]
- config.before(:suite) do
- ActiveRecord::Base.establish_connection DB_SECOND
- DatabaseCleaner.strategy = :deletion
- ActiveRecord::Base.establish_connection current_db
- DatabaseCleaner.strategy = :deletion
- end
- config.before(:each) do
- ActiveRecord::Base.establish_connection DB_SECOND
- DatabaseCleaner.start
- ActiveRecord::Base.establish_connection current_db
- DatabaseCleaner.start
- end
- config.after(:each) do
- ActiveRecord::Base.establish_connection DB_SECOND
- DatabaseCleaner.clean_with :deletion
- ActiveRecord::Base.establish_connection current_db
- DatabaseCleaner.clean_with :deletion
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement