require 'database_cleaner'

RSpec.configure do |config|
  DatabaseCleaner.strategy = :transaction

  config.around(:each) do |example|
    if example.metadata[:js]
      example.run
      DatabaseCleaner.clean_with(:truncation)
    else
      DatabaseCleaner.start
      example.run
      DatabaseCleaner.clean
    end
  end
end

require 'database_cleaner'

RSpec.configure do |config|
  config.before(:each) do |example|
    DatabaseCleaner.clean_with(:truncation)
  end
end

Switch to truncation cleaning strategy across the board.
Switch to truncation cleaning strategy across the board.

Something hokey has started happening when it moves from one JS spec to
the next.  It gets stuck in the middle of a transaction.  I have used
the dynamic strategy choosing thing in another app with success, but
it's failing here and I don't want to deal with it right now.
