test/test_helper.rb in loco-rails-3.0.3 vs test/test_helper.rb in loco-rails-3.0.4
- old
+ new
@@ -1,17 +1,19 @@
-ENV["RAILS_ENV"] = "test"
-require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
-ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
-ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__)
+# frozen_string_literal: true
+
+ENV['RAILS_ENV'] = 'test'
+require File.expand_path('../test/dummy/config/environment.rb', __dir__)
+ActiveRecord::Migrator.migrations_paths = [File.expand_path('../test/dummy/db/migrate', __dir__)]
+ActiveRecord::Migrator.migrations_paths << File.expand_path('../db/migrate', __dir__)
require 'rails/test_help'
require 'capybara/rails'
require 'database_cleaner'
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
if ActiveSupport::TestCase.respond_to?(:fixture_path=)
- ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
+ ActiveSupport::TestCase.fixture_path = File.expand_path('fixtures', __dir__)
ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
ActiveSupport::TestCase.fixtures :all
end
Capybara.register_driver :chrome do |app|
@@ -24,17 +26,13 @@
Capybara.server = :puma
# Filter out Minitest backtrace while allowing backtrace from other libraries to be shown.
Minitest.backtrace_filter = Minitest::BacktraceFilter.new
-DatabaseCleaner.strategy = :truncation
+DatabaseCleaner.strategy = :truncation, { except: %w[ar_internal_metadata] }
class ActiveSupport::TestCase
- if Rails.version.to_f >= 5
- self.use_transactional_tests = false
- else
- self.use_transactional_fixtures = false
- end
+ self.use_transactional_tests = false
fixtures :all
def setup
DatabaseCleaner.start