Skip to content

Commit

Permalink
use transactional fixtures in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timcowlishaw committed Oct 10, 2024
1 parent 94a82d1 commit e1ee360
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 21 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ gem 'workflow-activerecord'
gem 'em-mqtt'

group :test do
gem "database_cleaner-active_record"
gem 'simplecov', require: false
gem 'timecop'
gem 'vcr'
Expand Down
7 changes: 1 addition & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ GEM
css_parser (1.14.0)
addressable
dalli (3.2.4)
database_cleaner-active_record (2.2.0)
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
date (3.3.3)
date_validator (0.12.0)
activemodel (>= 3)
Expand Down Expand Up @@ -549,7 +545,6 @@ DEPENDENCIES
cane
countries
dalli
database_cleaner-active_record
date_validator
diffy
doorkeeper (~> 5)
Expand Down Expand Up @@ -621,4 +616,4 @@ RUBY VERSION
ruby 3.0.6p216

BUNDLED WITH
2.5.17
2.5.21
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
config.use_transactional_fixtures = false
config.use_transactional_fixtures = true

# RSpec Rails can automatically mix in different behaviours to your tests
# based on their file location, for example enabling you to call `get` and
Expand Down
13 changes: 0 additions & 13 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# users commonly want.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
require "database_cleaner/active_record"
RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest
Expand All @@ -40,18 +39,6 @@
mocks.verify_partial_doubles = true
end

DatabaseCleaner.strategy = :truncation

config.before(:suite) do
DatabaseCleaner.clean
end

config.around(:each) do |example|
DatabaseCleaner.cleaning do
example.run
end
end

# The settings below are suggested to provide a good initial experience
# with RSpec, but feel free to customize to your heart's content.

Expand Down

0 comments on commit e1ee360

Please sign in to comment.