diff options
-rw-r--r-- | Gemfile.lock | 2 | ||||
-rw-r--r-- | spec/spec_helper.rb | 3 | ||||
-rw-r--r-- | spec/support/db_cleaner.rb | 24 |
3 files changed, 24 insertions, 5 deletions
diff --git a/Gemfile.lock b/Gemfile.lock index 5124863692a..0d13ed5884c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -89,7 +89,7 @@ GEM d3_rails (3.1.10) railties (>= 3.1.0) daemons (1.1.9) - database_cleaner (1.2.0) + database_cleaner (1.3.0) debug_inspector (0.0.2) default_value_for (3.0.0) activerecord (>= 3.2.0, < 5.0) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e6b1f816df0..65a641bcf12 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -27,6 +27,8 @@ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} WebMock.disable_net_connect!(allow_localhost: true) RSpec.configure do |config| + config.use_transactional_fixtures = false + config.use_instantiated_fixtures = false config.mock_with :rspec config.include LoginHelpers, type: :feature @@ -39,7 +41,6 @@ RSpec.configure do |config| # 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.before(:suite) do TestEnv.init(observers: false, init_repos: true, repos: false) diff --git a/spec/support/db_cleaner.rb b/spec/support/db_cleaner.rb index f2b310245bd..d2d532d9738 100644 --- a/spec/support/db_cleaner.rb +++ b/spec/support/db_cleaner.rb @@ -1,13 +1,31 @@ +# RSpec.configure do |config| + +# config.around(:each) do |example| +# DatabaseCleaner.strategy = :transaction +# DatabaseCleaner.clean_with(:truncation) +# DatabaseCleaner.cleaning do +# example.run +# end +# end + +# config.around(:each, js: true) do |example| +# DatabaseCleaner.strategy = :truncation +# DatabaseCleaner.clean_with(:truncation) +# DatabaseCleaner.cleaning do +# example.run +# end +# end +# end RSpec.configure do |config| - config.around(:each) do + config.before(:suite) do DatabaseCleaner.clean_with(:truncation) end - config.around(:each) do + config.before(:each) do DatabaseCleaner.strategy = :transaction end - config.around(:each, js: true) do + config.before(:each, :js => true) do DatabaseCleaner.strategy = :truncation end |