Skip to content

Commit

Permalink
Remove Database Cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
bensheldon committed Jan 30, 2023
1 parent 4113fcb commit 6c86065
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
7 changes: 0 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ GEM
console (1.16.2)
fiber-local
crass (1.0.6)
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)
date (3.3.3)
date (3.3.3-java)
diff-lcs (1.5.0)
Expand Down Expand Up @@ -425,7 +419,6 @@ DEPENDENCIES
appraisal!
benchmark-ips
capybara
database_cleaner
dotenv (~> 2.7.6)
easy_translate
erb_lint
Expand Down
1 change: 0 additions & 1 deletion good_job.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ Gem::Specification.new do |spec|

spec.add_development_dependency "benchmark-ips"
spec.add_development_dependency "capybara"
spec.add_development_dependency "database_cleaner"
spec.add_development_dependency "dotenv", "~> 2.7.6" # required for Ruby 2.5 support
spec.add_development_dependency "foreman"
spec.add_development_dependency "gem-release"
Expand Down
1 change: 0 additions & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
require 'rspec/rails'
require 'database_cleaner'
require 'pry'
# Add additional requires below this line. Rails is not loaded until this point!

Expand Down
8 changes: 3 additions & 5 deletions spec/support/database_cleaner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
config.use_transactional_fixtures = false

config.before(:suite) do
DatabaseCleaner.strategy = :truncation
DatabaseCleaner.clean_with :truncation
ActiveRecord::Tasks::DatabaseTasks.truncate_all
end

config.around do |example|
DatabaseCleaner.cleaning do
example.run
end
example.run
ActiveRecord::Tasks::DatabaseTasks.truncate_all
end
end

0 comments on commit 6c86065

Please sign in to comment.