diff --git a/Gemfile b/Gemfile index 55e91da8..9556146c 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,6 @@ gem "mysql2", github: "brianmario/mysql2" gem "globalid" gem "i18n" gem "redis" -gem "database_cleaner" gem "pry" gem "mocha" diff --git a/Gemfile.lock b/Gemfile.lock index 09206077..55b07da3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,12 +30,6 @@ GEM coderay (1.1.3) concurrent-ruby (1.1.10) connection_pool (2.2.5) - database_cleaner (2.0.1) - database_cleaner-active_record (~> 2.0.0) - database_cleaner-active_record (2.0.1) - activerecord (>= 5.a) - database_cleaner-core (~> 2.0.0) - database_cleaner-core (2.0.1) globalid (1.0.0) activesupport (>= 5.0) i18n (1.12.0) @@ -108,7 +102,6 @@ PLATFORMS DEPENDENCIES activerecord - database_cleaner globalid i18n job-iteration! diff --git a/test/test_helper.rb b/test/test_helper.rb index 6bcdc8cd..80cbd963 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -15,7 +15,6 @@ require "active_record" require "pry" require "mocha/minitest" -require "database_cleaner" GlobalID.app = "iteration" ActiveRecord::Base.include(GlobalID::Identification) # https://github.com/rails/globalid/blob/main/lib/global_id/railtie.rb @@ -74,8 +73,6 @@ class Product < ActiveRecord::Base t.timestamps end -DatabaseCleaner.strategy = :truncation - module LoggingHelpers def assert_logged(message) old_logger = ActiveJob::Base.logger @@ -117,7 +114,7 @@ class IterationUnitTest < ActiveSupport::TestCase teardown do ActiveJob::Base.queue_adapter.enqueued_jobs = [] - DatabaseCleaner.clean + truncate_fixtures end def insert_fixtures @@ -125,4 +122,8 @@ def insert_fixtures Product.create!(name: "lipstick #{n}") end end + + def truncate_fixtures + ActiveRecord::Base.connection.truncate(Product.table_name) + end end