From 9ded1cb36e6128a1df9087c7ec12ebe50c4e2de5 Mon Sep 17 00:00:00 2001 From: Alexander Meindl Date: Tue, 10 Dec 2024 21:29:10 +0100 Subject: [PATCH] Use same fixtures for all tests --- test/functional/account_controller_test.rb | 10 ---- ...dditionals_assign_to_me_controller_test.rb | 25 ---------- ...ditionals_change_status_controller_test.rb | 25 ---------- .../additionals_macros_controller_test.rb | 7 --- test/functional/admin_controller_test.rb | 2 - .../auto_completes_controller_test.rb | 6 --- .../dashboard_async_blocks_controller_test.rb | 16 ------- test/functional/dashboards_controller_test.rb | 15 ------ test/functional/issues_controller_test.rb | 15 ------ test/functional/projects_controller_test.rb | 14 ------ test/functional/reports_controller_test.rb | 9 ---- test/functional/users_controller_test.rb | 10 ---- test/functional/welcome_controller_test.rb | 3 -- test/functional/wiki_controller_test.rb | 17 ------- test/global_fixtures_helper.rb | 48 +++++++++++++++++++ test/integration/api_test/issues_test.rb | 21 -------- test/integration/api_test/projects_test.rb | 12 ----- test/integration/common_views_test.rb | 16 ------- test/integration/library_test.rb | 17 ------- test/test_helper.rb | 23 ++++++--- test/unit/additionals_fontawesome_test.rb | 9 ---- test/unit/additionals_journal_test.rb | 8 ---- test/unit/additionals_macro_test.rb | 9 ---- test/unit/additionals_test.rb | 5 -- test/unit/dashboard_content_test.rb | 6 --- test/unit/dashboard_test.rb | 9 ---- test/unit/entity_method_test.rb | 9 ---- test/unit/helpers/global_helper_test.rb | 13 +---- test/unit/issue_test.rb | 9 ---- test/unit/project_test.rb | 18 ------- test/unit/query_test.rb | 9 ---- test/unit/redmine_access_control_test.rb | 5 -- test/unit/role_test.rb | 5 -- test/unit/time_entry_test.rb | 10 ---- test/unit/user_test.rb | 11 ----- 35 files changed, 66 insertions(+), 380 deletions(-) create mode 100644 test/global_fixtures_helper.rb diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb index 0d289c86..9338f698 100644 --- a/test/functional/account_controller_test.rb +++ b/test/functional/account_controller_test.rb @@ -3,16 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class AccountControllerTest < Additionals::ControllerTest - fixtures :users, :groups_users, :email_addresses, :user_preferences, - :roles, :members, :member_roles, - :issues, :issue_statuses, :issue_relations, - :issues, :issue_statuses, :issue_categories, - :versions, :trackers, - :projects, :projects_trackers, :enabled_modules, - :enumerations - - fixtures :hrm_user_types, :hrm_working_calendars if AdditionalsPlugin.active_hrm? - def setup Setting.default_language = 'en' User.current = nil diff --git a/test/functional/additionals_assign_to_me_controller_test.rb b/test/functional/additionals_assign_to_me_controller_test.rb index 1a5572e2..c39d9e83 100644 --- a/test/functional/additionals_assign_to_me_controller_test.rb +++ b/test/functional/additionals_assign_to_me_controller_test.rb @@ -3,31 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class AdditionalsAssignToMeControllerTest < Additionals::ControllerTest - fixtures :projects, - :users, :email_addresses, :user_preferences, - :roles, - :members, - :member_roles, - :issues, - :issue_statuses, - :issue_relations, - :versions, - :trackers, - :projects_trackers, - :issue_categories, - :enabled_modules, - :enumerations, - :attachments, - :workflows, - :custom_fields, - :custom_values, - :custom_fields_projects, - :custom_fields_trackers, - :time_entries, - :journals, - :journal_details, - :queries - test 'assign issue to user' do session[:user_id] = 2 assert_difference 'Journal.count' do diff --git a/test/functional/additionals_change_status_controller_test.rb b/test/functional/additionals_change_status_controller_test.rb index 86a1053d..45ebda17 100644 --- a/test/functional/additionals_change_status_controller_test.rb +++ b/test/functional/additionals_change_status_controller_test.rb @@ -3,31 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class AdditionalsChangeStatusControllerTest < Additionals::ControllerTest - fixtures :projects, - :users, :email_addresses, :user_preferences, - :roles, - :members, - :member_roles, - :issues, - :issue_statuses, - :issue_relations, - :versions, - :trackers, - :projects_trackers, - :issue_categories, - :enabled_modules, - :enumerations, - :attachments, - :workflows, - :custom_fields, - :custom_values, - :custom_fields_projects, - :custom_fields_trackers, - :time_entries, - :journals, - :journal_details, - :queries - test 'assign new status to issue' do session[:user_id] = 2 assert_difference 'Journal.count' do diff --git a/test/functional/additionals_macros_controller_test.rb b/test/functional/additionals_macros_controller_test.rb index fe42158b..9a689076 100644 --- a/test/functional/additionals_macros_controller_test.rb +++ b/test/functional/additionals_macros_controller_test.rb @@ -3,13 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class AdditionalsMacrosControllerTest < Additionals::ControllerTest - fixtures :projects, - :users, - :roles, - :members, - :member_roles, - :enabled_modules - def setup prepare_tests end diff --git a/test/functional/admin_controller_test.rb b/test/functional/admin_controller_test.rb index 7ed8777a..01e77235 100644 --- a/test/functional/admin_controller_test.rb +++ b/test/functional/admin_controller_test.rb @@ -3,8 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class AdminControllerTest < Additionals::ControllerTest - fixtures :users, :email_addresses, :roles - def setup User.current = nil @request.session[:user_id] = 1 diff --git a/test/functional/auto_completes_controller_test.rb b/test/functional/auto_completes_controller_test.rb index 4728ce2c..49c39c28 100644 --- a/test/functional/auto_completes_controller_test.rb +++ b/test/functional/auto_completes_controller_test.rb @@ -3,12 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class AutoCompletesControllerTest < Additionals::ControllerTest - fixtures :projects, :email_addresses, - :enumerations, :users, :groups_users, - :roles, - :members, :member_roles, - :enabled_modules - def setup prepare_tests Setting.default_language = 'en' diff --git a/test/functional/dashboard_async_blocks_controller_test.rb b/test/functional/dashboard_async_blocks_controller_test.rb index b81aa793..3b30e193 100644 --- a/test/functional/dashboard_async_blocks_controller_test.rb +++ b/test/functional/dashboard_async_blocks_controller_test.rb @@ -3,22 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class DashboardAsyncBlocksControllerTest < Additionals::ControllerTest - fixtures :users, :email_addresses, :roles, - :enumerations, - :projects, :projects_trackers, :enabled_modules, - :members, :member_roles, - :issues, :issue_statuses, :issue_categories, :issue_relations, - :versions, - :trackers, - :workflows, - :custom_fields, :custom_values, :custom_fields_projects, :custom_fields_trackers, - :time_entries, - :watchers, - :journals, :journal_details, - :repositories, :changesets, - :queries, - :dashboards, :dashboard_roles - include Redmine::I18n def setup diff --git a/test/functional/dashboards_controller_test.rb b/test/functional/dashboards_controller_test.rb index d518bd21..8fda39ff 100644 --- a/test/functional/dashboards_controller_test.rb +++ b/test/functional/dashboards_controller_test.rb @@ -3,21 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class DashboardsControllerTest < Additionals::ControllerTest - fixtures :projects, - :users, - :roles, - :members, - :member_roles, - :issues, - :issue_statuses, - :versions, - :trackers, - :projects_trackers, - :issue_categories, - :enabled_modules, - :dashboards, :dashboard_roles, - :queries - include CrudControllerBase def setup diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 572b480e..42a8dabc 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -3,21 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class IssuesControllerTest < Additionals::ControllerTest - fixtures :users, :email_addresses, :roles, - :enumerations, - :projects, :projects_trackers, :enabled_modules, - :members, :member_roles, - :issues, :issue_statuses, :issue_categories, :issue_relations, - :versions, - :trackers, - :workflows, - :custom_fields, :custom_values, :custom_fields_projects, :custom_fields_trackers, - :time_entries, - :watchers, :attachments, - :journals, :journal_details, - :repositories, :changesets, - :queries - def setup manager_role = roles :roles_001 manager_role.add_permission! :edit_issue_author diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index 89c09922..ddce7901 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -11,20 +11,6 @@ class ViewDashboardBottomRenderOn < Redmine::Hook::ViewListener end class ProjectsControllerTest < Additionals::ControllerTest - fixtures :projects, - :users, - :roles, - :members, - :member_roles, - :issues, - :issue_statuses, - :versions, - :trackers, - :projects_trackers, - :issue_categories, - :enabled_modules, - :dashboards, :dashboard_roles - def setup Setting.default_language = 'en' User.current = nil diff --git a/test/functional/reports_controller_test.rb b/test/functional/reports_controller_test.rb index 65b3349d..fa1cdf45 100644 --- a/test/functional/reports_controller_test.rb +++ b/test/functional/reports_controller_test.rb @@ -3,15 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class ReportsControllerTest < Additionals::ControllerTest - fixtures :users, :groups_users, :email_addresses, :user_preferences, - :roles, :members, :member_roles, - :projects, :trackers, :issue_statuses, :issues, - :enumerations, :issue_categories, - :projects_trackers, - :roles, :member_roles, :members, - :enabled_modules, :workflows, - :versions - def setup prepare_tests end diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb index d4e29302..ac05bba7 100644 --- a/test/functional/users_controller_test.rb +++ b/test/functional/users_controller_test.rb @@ -11,16 +11,6 @@ class ViewUsersShowInfoRenderOn < Redmine::Hook::ViewListener end class UsersControllerTest < Additionals::ControllerTest - fixtures :users, :groups_users, :email_addresses, :user_preferences, - :roles, :members, :member_roles, - :issues, :issue_statuses, :issue_relations, - :issues, :issue_statuses, :issue_categories, - :versions, :trackers, - :projects, :projects_trackers, :enabled_modules, - :enumerations - - fixtures :hrm_user_types, :hrm_working_calendars if AdditionalsPlugin.active_hrm? - include Redmine::I18n def setup diff --git a/test/functional/welcome_controller_test.rb b/test/functional/welcome_controller_test.rb index 726b398d..3ea23a1b 100644 --- a/test/functional/welcome_controller_test.rb +++ b/test/functional/welcome_controller_test.rb @@ -19,9 +19,6 @@ class ViewDashboardBottomRenderOn < Redmine::Hook::ViewListener end class WelcomeControllerTest < Additionals::ControllerTest - fixtures :projects, :news, :users, :members, - :dashboards, :dashboard_roles - def setup Setting.default_language = 'en' User.current = nil diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index b4a872a5..ba537ef6 100644 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -3,23 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class WikiControllerTest < Additionals::ControllerTest - fixtures :projects, - :users, - :roles, - :members, - :member_roles, - :trackers, - :groups_users, - :projects_trackers, - :enabled_modules, - :issue_statuses, - :issues, - :enumerations, - :custom_fields, - :custom_values, - :custom_fields_trackers, - :wikis - WIKI_MACRO_USER_ID = 2 def setup diff --git a/test/global_fixtures_helper.rb b/test/global_fixtures_helper.rb new file mode 100644 index 00000000..80b1a8cc --- /dev/null +++ b/test/global_fixtures_helper.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module Additionals + module GlobalFixturesHelper + def plugin_fixture_path + "#{File.dirname __FILE__}/fixtures" + end + + def fixtures(*table_names) + return super if table_names.first == :all + + dir = plugin_fixture_path + table_names.each do |x| + ActiveRecord::FixtureSet.create_fixtures dir, x if File.exist? File.join(dir, "#{x}.yml") + end + + super + end + + def fixtures_list + if use_transactional_tests + redmine_fixtures_list + plugin_fixtures_list + else + # if use_transactional_tests = false custom fixtures in plugin directory does not work + redmine_fixtures_list + end + end + + # NOTE: overwrite it for custom fixtures + def plugin_fixtures_list + [] + end + + def redmine_fixtures_list + %i[users groups_users user_preferences email_addresses roles enumerations + auth_sources tokens enabled_modules + projects projects_trackers + members member_roles news + issues issue_statuses issue_categories issue_relations + journals journal_details watchers attachments + custom_fields custom_values custom_fields_projects custom_fields_trackers + versions trackers workflows time_entries + repositories changesets changes + wikis wiki_pages wiki_contents wiki_content_versions + queries] + end + end +end diff --git a/test/integration/api_test/issues_test.rb b/test/integration/api_test/issues_test.rb index f7fc96dd..c266af35 100644 --- a/test/integration/api_test/issues_test.rb +++ b/test/integration/api_test/issues_test.rb @@ -4,27 +4,6 @@ module ApiTest class IssuesTest < Additionals::ApiTest - fixtures :projects, - :users, - :roles, - :members, - :member_roles, - :issues, - :issue_statuses, - :issue_relations, - :versions, - :trackers, - :projects_trackers, - :issue_categories, - :enabled_modules, - :enumerations, - :attachments, - :workflows, - :time_entries, - :journals, - :journal_details, - :queries - test 'GET /issues.xml should contain metadata' do get '/issues.xml' diff --git a/test/integration/api_test/projects_test.rb b/test/integration/api_test/projects_test.rb index 1f79fe7c..394e25cb 100644 --- a/test/integration/api_test/projects_test.rb +++ b/test/integration/api_test/projects_test.rb @@ -4,18 +4,6 @@ module ApiTest class ProjectsTest < Additionals::ApiTest - fixtures :users, :email_addresses, :roles, - :enumerations, - :projects, :projects_trackers, :enabled_modules, - :members, :member_roles, - :issues, :issue_statuses, :issue_categories, - :journals, :journal_details, - :trackers, - :attachments, - :custom_fields, :custom_values, - :time_entries, - :dashboards, :dashboard_roles - test 'GET /projects.xml should return projects' do get '/projects.xml', headers: credentials('jsmith') diff --git a/test/integration/common_views_test.rb b/test/integration/common_views_test.rb index f5853d4e..ffdfed9e 100644 --- a/test/integration/common_views_test.rb +++ b/test/integration/common_views_test.rb @@ -3,22 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class CommonViewsTest < Additionals::IntegrationTest - fixtures :projects, - :users, - :roles, - :members, - :member_roles, - :trackers, - :projects_trackers, - :enabled_modules, - :issue_statuses, - :issue_categories, - :issues, - :enumerations, - :custom_fields, - :custom_values, - :custom_fields_trackers - def setup prepare_tests end diff --git a/test/integration/library_test.rb b/test/integration/library_test.rb index cc751359..b863ddd8 100644 --- a/test/integration/library_test.rb +++ b/test/integration/library_test.rb @@ -3,23 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class JavascriptLibraryTest < Additionals::IntegrationTest - fixtures :projects, - :users, - :roles, - :members, - :member_roles, - :trackers, - :projects_trackers, - :enabled_modules, - :issue_statuses, - :issues, - :enumerations, - :custom_fields, - :custom_values, - :custom_fields_trackers, - :dashboards, :dashboard_roles, - :queries - def test_not_loaded_chart_css_library skip 'not tested if reporting is active' if AdditionalsPlugin.active_reporting? diff --git a/test/test_helper.rb b/test/test_helper.rb index 0280d064..5e281d43 100755 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -12,6 +12,7 @@ Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new, Minitest::Reporters::JUnitReporter.new] require File.expand_path "#{File.dirname __FILE__}/../../../test/test_helper" +require File.expand_path "#{File.dirname __FILE__}/global_fixtures_helper" require File.expand_path "#{File.dirname __FILE__}/global_test_helper" require File.expand_path "#{File.dirname __FILE__}/crud_controller_base" @@ -43,32 +44,42 @@ def emoji_heart_tag end module PluginFixturesLoader - def fixtures(*table_names) - dir = "#{File.dirname __FILE__}/fixtures/" - table_names.each do |x| - ActiveRecord::FixtureSet.create_fixtures dir, x if File.exist? "#{dir}/#{x}.yml" - end - super table_names + include Additionals::GlobalFixturesHelper + + def plugin_fixtures_list + custom = %i[dashboards dashboard_roles] + custom += %i[hrm_user_types hrm_working_calendars] if AdditionalsPlugin.active_hrm? + custom end end + class HelperTest < Redmine::HelperTest + include Additionals::TestHelper + extend PluginFixturesLoader + fixtures(*fixtures_list) + end + class ControllerTest < Redmine::ControllerTest include Additionals::TestHelper extend PluginFixturesLoader + fixtures(*fixtures_list) end class TestCase < ActiveSupport::TestCase include Additionals::TestHelper extend PluginFixturesLoader + fixtures(*fixtures_list) end class IntegrationTest < Redmine::IntegrationTest include Additionals::TestHelper extend PluginFixturesLoader + fixtures(*fixtures_list) end class ApiTest < Redmine::ApiTest::Base include Additionals::TestHelper extend PluginFixturesLoader + fixtures(*fixtures_list) end end diff --git a/test/unit/additionals_fontawesome_test.rb b/test/unit/additionals_fontawesome_test.rb index 6d1e6df7..3d7df406 100644 --- a/test/unit/additionals_fontawesome_test.rb +++ b/test/unit/additionals_fontawesome_test.rb @@ -3,15 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class AdditionalsFontAwesomeTest < Additionals::TestCase - fixtures :projects, :users, :members, :member_roles, :roles, - :trackers, :projects_trackers, - :enabled_modules, - :issue_statuses, :issue_categories, :workflows, - :enumerations, - :issues, :journals, :journal_details, - :custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values, - :time_entries - include Redmine::I18n def setup diff --git a/test/unit/additionals_journal_test.rb b/test/unit/additionals_journal_test.rb index 2a91d86b..a752c546 100644 --- a/test/unit/additionals_journal_test.rb +++ b/test/unit/additionals_journal_test.rb @@ -3,14 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class AdditionalsJournalTest < Additionals::TestCase - fixtures :projects, :users, :members, :member_roles, :roles, - :trackers, :projects_trackers, - :enabled_modules, - :issue_statuses, :issue_categories, :workflows, - :enumerations, - :issues, :journals, :journal_details, - :custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values - def setup prepare_tests @issue = issues :issues_001 diff --git a/test/unit/additionals_macro_test.rb b/test/unit/additionals_macro_test.rb index e18ddc25..9e77d641 100644 --- a/test/unit/additionals_macro_test.rb +++ b/test/unit/additionals_macro_test.rb @@ -3,15 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class AdditionalsMacroTest < Additionals::TestCase - fixtures :projects, :users, :members, :member_roles, :roles, - :trackers, :projects_trackers, - :enabled_modules, - :issue_statuses, :issue_categories, :workflows, - :enumerations, - :issues, :journals, :journal_details, - :custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values, - :time_entries - include Redmine::I18n def setup diff --git a/test/unit/additionals_test.rb b/test/unit/additionals_test.rb index 83a4a85f..4052eafb 100644 --- a/test/unit/additionals_test.rb +++ b/test/unit/additionals_test.rb @@ -3,11 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class AdditionalsTest < Additionals::TestCase - fixtures :projects, :users, :members, :member_roles, :roles, - :trackers, :projects_trackers, - :enabled_modules, - :enumerations - include Redmine::I18n def setup diff --git a/test/unit/dashboard_content_test.rb b/test/unit/dashboard_content_test.rb index 8048224a..53bf75d3 100644 --- a/test/unit/dashboard_content_test.rb +++ b/test/unit/dashboard_content_test.rb @@ -3,12 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class DashboardContentTest < Additionals::TestCase - fixtures :projects, :users, :members, :member_roles, :roles, - :trackers, :projects_trackers, - :enabled_modules, - :enumerations, - :dashboards, :dashboard_roles - def setup prepare_tests end diff --git a/test/unit/dashboard_test.rb b/test/unit/dashboard_test.rb index a5dae8e7..8d0f6b9f 100644 --- a/test/unit/dashboard_test.rb +++ b/test/unit/dashboard_test.rb @@ -3,15 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class DashboardTest < Additionals::TestCase - fixtures :projects, :users, :members, :member_roles, :roles, - :trackers, :projects_trackers, - :enabled_modules, - :issue_statuses, :issue_categories, :workflows, - :enumerations, - :issues, :journals, :journal_details, - :custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values, - :dashboards, :dashboard_roles - def setup prepare_tests User.current = users :users_002 diff --git a/test/unit/entity_method_test.rb b/test/unit/entity_method_test.rb index 5e851618..deec9363 100644 --- a/test/unit/entity_method_test.rb +++ b/test/unit/entity_method_test.rb @@ -3,15 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class EntityMethodTest < Additionals::TestCase - fixtures :projects, :users, :members, :member_roles, :roles, - :trackers, :projects_trackers, - :enabled_modules, - :issue_statuses, :issue_categories, :workflows, - :enumerations, - :issues, :journals, :journal_details, - :custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values, - :time_entries - include Redmine::I18n def setup diff --git a/test/unit/helpers/global_helper_test.rb b/test/unit/helpers/global_helper_test.rb index 422f18d8..3284b12b 100644 --- a/test/unit/helpers/global_helper_test.rb +++ b/test/unit/helpers/global_helper_test.rb @@ -2,7 +2,7 @@ require File.expand_path '../../../test_helper', __FILE__ -class GlobalHelperTest < Redmine::HelperTest +class GlobalHelperTest < Additionals::HelperTest include Additionals::Helpers include RedminePluginKit::Helpers::GlobalHelper include AdditionalsFontawesomeHelper @@ -12,17 +12,6 @@ class GlobalHelperTest < Redmine::HelperTest include Redmine::I18n include ERB::Util - fixtures :projects, :trackers, :issue_statuses, :issues, - :enumerations, :users, :issue_categories, - :projects_trackers, - :roles, - :member_roles, - :members, - :enabled_modules, - :custom_fields, - :attachments, - :versions - def setup super set_language_if_valid 'en' diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index 87cb0de0..8dc3cf70 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -3,15 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class IssueTest < Additionals::TestCase - fixtures :projects, :users, :groups_users, :members, :member_roles, :roles, - :trackers, :projects_trackers, - :enabled_modules, - :issue_statuses, :issue_categories, :workflows, - :enumerations, - :issues, :journals, :journal_details, - :custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values, - :time_entries - include Redmine::I18n def setup diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb index d8142dd4..67938a0d 100644 --- a/test/unit/project_test.rb +++ b/test/unit/project_test.rb @@ -3,24 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class ProjectTest < Additionals::TestCase - fixtures :projects, :trackers, :issue_statuses, :issues, - :journals, :journal_details, - :enumerations, :users, :issue_categories, - :projects_trackers, - :custom_fields, - :custom_fields_projects, - :custom_fields_trackers, - :custom_values, - :roles, - :member_roles, - :members, - :enabled_modules, - :groups_users, - :repositories, - :workflows, - :attachments, - :dashboards, :dashboard_roles - def setup prepare_tests User.current = nil diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb index 8ec62ed9..25113c5a 100644 --- a/test/unit/query_test.rb +++ b/test/unit/query_test.rb @@ -3,15 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class QueryTest < Additionals::TestCase - fixtures :projects, :users, :members, :member_roles, :roles, - :groups_users, - :trackers, :projects_trackers, - :enabled_modules, - :roles, - :repositories - - fixtures :hrm_user_types, :hrm_working_calendars if AdditionalsPlugin.active_hrm? - def setup User.current = nil end diff --git a/test/unit/redmine_access_control_test.rb b/test/unit/redmine_access_control_test.rb index 0413d093..1ae410ff 100644 --- a/test/unit/redmine_access_control_test.rb +++ b/test/unit/redmine_access_control_test.rb @@ -3,11 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class RedmineAccessControlTest < Additionals::TestCase - fixtures :projects, :users, :members, :member_roles, :roles, - :trackers, :projects_trackers, - :enabled_modules, - :roles - def setup prepare_tests end diff --git a/test/unit/role_test.rb b/test/unit/role_test.rb index 2b48691a..8500de8c 100644 --- a/test/unit/role_test.rb +++ b/test/unit/role_test.rb @@ -3,11 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class RoleTest < Additionals::TestCase - fixtures :projects, :users, :members, :member_roles, :roles, - :trackers, :projects_trackers, - :enabled_modules, - :roles - def setup prepare_tests end diff --git a/test/unit/time_entry_test.rb b/test/unit/time_entry_test.rb index 612db637..37845742 100644 --- a/test/unit/time_entry_test.rb +++ b/test/unit/time_entry_test.rb @@ -3,16 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class TimeEntryTest < Additionals::TestCase - fixtures :users, :email_addresses, - :issues, :projects, :time_entries, - :members, :roles, :member_roles, - :trackers, :issue_statuses, - :projects_trackers, - :journals, :journal_details, - :issue_categories, :enumerations, - :groups_users, - :enabled_modules - def setup prepare_tests end diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb index 33b20087..4de9a142 100644 --- a/test/unit/user_test.rb +++ b/test/unit/user_test.rb @@ -3,17 +3,6 @@ require File.expand_path '../../test_helper', __FILE__ class UserTest < Additionals::TestCase - fixtures :users, :groups_users, :email_addresses, - :members, :projects, :roles, :member_roles, :auth_sources, - :trackers, :issue_statuses, - :projects_trackers, - :watchers, - :issue_categories, :enumerations, :issues, - :journals, :journal_details, - :enabled_modules, - :tokens, :user_preferences, - :dashboards, :dashboard_roles - def setup prepare_tests User.current = users :users_002