Skip to content

Commit

Permalink
Ensure database cleaning is very last in each spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawthorn committed Feb 22, 2018
1 parent ab094be commit e9a0999
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/solidus_support/extension/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
end

# Before each spec check if it is a Javascript test and switch between using database transactions or not where necessary.
config.before :each do
config.prepend_before :each do
DatabaseCleaner.strategy = RSpec.current_example.metadata[:js] ? :truncation : :transaction
DatabaseCleaner.start

reset_spree_preferences
end

# After each spec clean the database.
config.after :each do
config.append_after :each do
DatabaseCleaner.clean
end
end

0 comments on commit e9a0999

Please sign in to comment.