mirror of
https://github.com/redmine/redmine.git
synced 2025-10-26 00:36:14 +02:00
Run Setting.clear_cache after each test in order to decrease the number of random failing tests (#43130).
Patch by Katsuya HIDAKA (user:hidakatsuya). git-svn-id: https://svn.redmine.org/redmine/trunk@23915 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -26,10 +26,6 @@ class ReactionsControllerTest < Redmine::ControllerTest
|
||||
@request.session[:user_id] = users(:users_002).id
|
||||
end
|
||||
|
||||
teardown do
|
||||
Setting.clear_cache
|
||||
end
|
||||
|
||||
test 'create for issue' do
|
||||
issue = issues(:issues_002)
|
||||
|
||||
|
||||
@@ -25,11 +25,6 @@ class SettingsControllerTest < Redmine::ControllerTest
|
||||
@request.session[:user_id] = 1 # admin
|
||||
end
|
||||
|
||||
def teardown
|
||||
Setting.delete_all
|
||||
Setting.clear_cache
|
||||
end
|
||||
|
||||
def test_index
|
||||
get :index
|
||||
assert_response :success
|
||||
|
||||
@@ -25,10 +25,6 @@ class SysControllerTest < Redmine::ControllerTest
|
||||
Setting.enabled_scm = %w(Subversion Git)
|
||||
end
|
||||
|
||||
def teardown
|
||||
Setting.clear_cache
|
||||
end
|
||||
|
||||
def test_projects_with_repository_enabled
|
||||
get :projects
|
||||
assert_response :success
|
||||
|
||||
@@ -27,10 +27,6 @@ class ReactionsHelperTest < ActionView::TestCase
|
||||
Setting.reactions_enabled = '1'
|
||||
end
|
||||
|
||||
teardown do
|
||||
Setting.clear_cache
|
||||
end
|
||||
|
||||
test 'reaction_id_for generates a DOM id' do
|
||||
assert_equal "reaction_issue_1", reaction_id_for(issues(:issues_001))
|
||||
end
|
||||
|
||||
@@ -61,6 +61,11 @@ class ActiveSupport::TestCase
|
||||
self.use_transactional_tests = true
|
||||
self.use_instantiated_fixtures = false
|
||||
|
||||
# Clear Settings cache after each test to prevent test interference
|
||||
teardown do
|
||||
Setting.clear_cache
|
||||
end
|
||||
|
||||
def uploaded_test_file(name, mime)
|
||||
fixture_file_upload(name.to_s, mime, true)
|
||||
end
|
||||
|
||||
@@ -26,10 +26,6 @@ class Redmine::ReactionTest < ActiveSupport::TestCase
|
||||
Setting.reactions_enabled = '1'
|
||||
end
|
||||
|
||||
teardown do
|
||||
Setting.clear_cache
|
||||
end
|
||||
|
||||
test 'preload_reaction_details preloads ReactionDetail for all objects in the collection' do
|
||||
User.current = users(:users_002)
|
||||
|
||||
|
||||
@@ -28,10 +28,6 @@ class MailHandlerTest < ActiveSupport::TestCase
|
||||
User.current = nil
|
||||
end
|
||||
|
||||
def teardown
|
||||
Setting.clear_cache
|
||||
end
|
||||
|
||||
def test_add_issue_with_specific_overrides
|
||||
issue =
|
||||
submit_email(
|
||||
|
||||
@@ -24,15 +24,7 @@ class SettingTest < ActiveSupport::TestCase
|
||||
User.current = nil
|
||||
end
|
||||
|
||||
def teardown
|
||||
Setting.delete_all
|
||||
Setting.clear_cache
|
||||
end
|
||||
|
||||
def test_read_default
|
||||
Setting.delete_all
|
||||
Setting.clear_cache
|
||||
|
||||
assert_equal "Redmine", Setting.app_title
|
||||
assert Setting.self_registration?
|
||||
assert !Setting.login_required?
|
||||
@@ -127,7 +119,6 @@ class SettingTest < ActiveSupport::TestCase
|
||||
assert_equal 'UTF-8', Setting.commit_update_keywords.first['keywords'].encoding.name
|
||||
ensure
|
||||
Setting.where(:name => 'commit_update_keywords').delete_all
|
||||
Setting.clear_cache
|
||||
end
|
||||
|
||||
def test_mail_from_format_should_be_validated
|
||||
|
||||
Reference in New Issue
Block a user