Guest User

Untitled

a guest
Mar 17th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. RSpec.configure do |config|
  2. config.use_transactional_fixtures = false
  3.  
  4. # Use transactions by default
  5. config.before :each do
  6. DatabaseCleaner.strategy = :transaction
  7. end
  8.  
  9. # For the javascript-enabled tests, switch to truncation, but *only on tables that were used*
  10. config.before :each, :js => true do
  11. DatabaseCleaner.strategy = :truncation, {:pre_count => true}
  12. end
  13.  
  14. config.before :each do
  15. DatabaseCleaner.start
  16. end
  17.  
  18. config.after :each do
  19. DatabaseCleaner.clean
  20. end
  21. end
Add Comment
Please, Sign In to add comment