Commit 2838a993da78bf365d7a84dc51f57a605fc99c96

Authored by Jeroen van Baarsen
1 parent 7cf1a425

DB cleaner reverted to a known working version

Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Showing 1 changed file with 31 additions and 10 deletions   Show diff stats
spec/support/db_cleaner.rb
  1 +# RSpec.configure do |config|
  2 +
  3 +# config.around(:each) do |example|
  4 +# DatabaseCleaner.strategy = :transaction
  5 +# DatabaseCleaner.clean_with(:truncation)
  6 +# DatabaseCleaner.cleaning do
  7 +# example.run
  8 +# end
  9 +# end
  10 +
  11 +# config.around(:each, js: true) do |example|
  12 +# DatabaseCleaner.strategy = :truncation
  13 +# DatabaseCleaner.clean_with(:truncation)
  14 +# DatabaseCleaner.cleaning do
  15 +# example.run
  16 +# end
  17 +# end
  18 +# end
1 RSpec.configure do |config| 19 RSpec.configure do |config|
  20 + config.before(:suite) do
  21 + DatabaseCleaner.clean_with(:truncation)
  22 + end
2 23
3 - config.around(:each) do |example| 24 + config.before(:each) do
4 DatabaseCleaner.strategy = :transaction 25 DatabaseCleaner.strategy = :transaction
5 - DatabaseCleaner.clean_with(:truncation)  
6 - DatabaseCleaner.cleaning do  
7 - example.run  
8 - end  
9 end 26 end
10 27
11 - config.around(:each, js: true) do |example| 28 + config.before(:each, :js => true) do
12 DatabaseCleaner.strategy = :truncation 29 DatabaseCleaner.strategy = :truncation
13 - DatabaseCleaner.clean_with(:truncation)  
14 - DatabaseCleaner.cleaning do  
15 - example.run  
16 - end 30 + end
  31 +
  32 + config.before(:each) do
  33 + DatabaseCleaner.start
  34 + end
  35 +
  36 + config.after(:each) do
  37 + DatabaseCleaner.clean
17 end 38 end
18 end 39 end