Guest User

Untitled

a guest
May 1st, 2016
305
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. RSpec.configure do |config|
  2.   current_db = Rails.configuration.database_configuration[Rails.env]
  3.  
  4.   config.before(:suite) do
  5.     ActiveRecord::Base.establish_connection DB_SECOND
  6.     DatabaseCleaner.strategy = :deletion
  7.     ActiveRecord::Base.establish_connection current_db
  8.     DatabaseCleaner.strategy = :deletion
  9.   end
  10.  
  11.   config.before(:each) do
  12.     ActiveRecord::Base.establish_connection DB_SECOND
  13.     DatabaseCleaner.start
  14.     ActiveRecord::Base.establish_connection current_db
  15.     DatabaseCleaner.start
  16.   end
  17.  
  18.   config.after(:each) do
  19.     ActiveRecord::Base.establish_connection DB_SECOND
  20.     DatabaseCleaner.clean_with :deletion
  21.     ActiveRecord::Base.establish_connection current_db
  22.     DatabaseCleaner.clean_with :deletion
  23.   end
  24. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×