From d03301b60e1cb8fbadcdebb15b72634de3e76761 Mon Sep 17 00:00:00 2001 From: Martin Linkhorst Date: Mon, 14 Jan 2013 17:06:15 +0100 Subject: [PATCH] there are so many side effects by using only a subset of the fixtures and also it creates lots of annoying noise in the test code. this commit changes individual requires to :all which fixes some tests when test files are run individually or in a different order. --- test/functional/account_controller_test.rb | 2 +- test/functional/admin_controller_test.rb | 2 +- .../functional/attachments_controller_test.rb | 3 +-- test/functional/boards_controller_test.rb | 2 +- .../custom_fields_controller_test.rb | 5 +--- test/functional/documents_controller_test.rb | 2 +- .../enumerations_controller_test.rb | 2 +- test/functional/groups_controller_test.rb | 2 +- .../issue_categories_controller_test.rb | 2 +- .../issue_relations_controller_test.rb | 12 +-------- .../issue_statuses_controller_test.rb | 2 +- test/functional/issues_controller_test.rb | 25 +------------------ .../issues_controller_transaction_test.rb | 24 +----------------- test/functional/journals_controller_test.rb | 5 +--- .../mail_handler_controller_test.rb | 2 +- test/functional/members_controller_test.rb | 2 +- test/functional/messages_controller_test.rb | 2 +- test/functional/my_controller_test.rb | 4 +-- .../news/comments_controller_test.rb | 2 +- test/functional/news_controller_test.rb | 2 +- test/functional/projects_controller_test.rb | 7 +----- test/functional/queries_controller_test.rb | 5 +--- .../repositories_controller_test.rb | 5 +--- ...repositories_filesystem_controller_test.rb | 2 +- .../repositories_git_controller_test.rb | 2 +- ...repositories_subversion_controller_test.rb | 5 +--- test/functional/roles_controller_test.rb | 2 +- test/functional/search_controller_test.rb | 6 +---- test/functional/settings_controller_test.rb | 2 +- test/functional/sys_controller_test.rb | 2 +- .../time_entries/reports_controller_test.rb | 7 +----- test/functional/timelog_controller_test.rb | 2 +- test/functional/trackers_controller_test.rb | 8 +----- test/functional/users_controller_test.rb | 11 +------- test/functional/versions_controller_test.rb | 11 +------- test/functional/watchers_controller_test.rb | 3 +-- test/functional/welcome_controller_test.rb | 4 +-- test/functional/wiki_controller_test.rb | 2 +- test/functional/wikis_controller_test.rb | 2 +- test/functional/workflows_controller_test.rb | 2 +- test/integration/account_test.rb | 2 +- test/integration/api_test/issues_test.rb | 24 +----------------- test/integration/api_test/projects_test.rb | 21 +--------------- test/integration/api_test/users_test.rb | 2 +- test/integration/issues_test.rb | 16 +----------- test/integration/projects_test.rb | 2 +- test/unit/activity_test.rb | 3 +-- test/unit/attachment_test.rb | 2 +- test/unit/board_test.rb | 2 +- test/unit/changeset_test.rb | 5 +--- test/unit/document_test.rb | 2 +- test/unit/helpers/application_helper_test.rb | 9 +------ test/unit/helpers/timelog_helper_test.rb | 8 +----- test/unit/issue_nested_set_test.rb | 10 +------- test/unit/issue_priority_test.rb | 2 +- test/unit/issue_relation_test.rb | 2 +- test/unit/issue_status_test.rb | 2 +- test/unit/issue_test.rb | 14 +---------- test/unit/journal_test.rb | 2 +- test/unit/ldap_auth_source_test.rb | 2 +- .../redmine/menu_manager/menu_helper_test.rb | 2 +- test/unit/news_test.rb | 2 +- test/unit/query_test.rb | 6 +---- test/unit/repository_filesystem_test.rb | 2 +- test/unit/repository_git_test.rb | 2 +- test/unit/repository_subversion_test.rb | 2 +- test/unit/role_test.rb | 2 +- test/unit/search_test.rb | 12 +-------- test/unit/time_entry_activity_test.rb | 2 +- test/unit/time_entry_test.rb | 2 +- test/unit/token_test.rb | 2 +- test/unit/tracker_test.rb | 2 +- test/unit/user_test.rb | 9 +------ test/unit/version_test.rb | 9 +------ test/unit/wiki_page_test.rb | 2 +- test/unit/wiki_redirect_test.rb | 2 +- test/unit/wiki_test.rb | 2 +- 77 files changed, 77 insertions(+), 311 deletions(-) diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb index ec1f9101e5..18c1f42385 100644 --- a/test/functional/account_controller_test.rb +++ b/test/functional/account_controller_test.rb @@ -18,7 +18,7 @@ require 'account_controller' class AccountController; def rescue_action(e) raise e end; end class AccountControllerTest < ActionController::TestCase - fixtures :users, :roles + fixtures :all def setup super diff --git a/test/functional/admin_controller_test.rb b/test/functional/admin_controller_test.rb index 7d6d2bdbae..b416bb7edb 100644 --- a/test/functional/admin_controller_test.rb +++ b/test/functional/admin_controller_test.rb @@ -18,7 +18,7 @@ require 'admin_controller' class AdminController; def rescue_action(e) raise e end; end class AdminControllerTest < ActionController::TestCase - fixtures :projects, :users, :roles + fixtures :all def setup @controller = AdminController.new diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb index 183214474e..283c3487bf 100644 --- a/test/functional/attachments_controller_test.rb +++ b/test/functional/attachments_controller_test.rb @@ -20,8 +20,7 @@ class AttachmentsController; def rescue_action(e) raise e end; end class AttachmentsControllerTest < ActionController::TestCase - fixtures :users, :projects, :roles, :members, :member_roles, :enabled_modules, :issues, :trackers, :attachments, - :versions, :wiki_pages, :wikis, :documents + fixtures :all def setup @controller = AttachmentsController.new diff --git a/test/functional/boards_controller_test.rb b/test/functional/boards_controller_test.rb index 808c3742bd..903882ae80 100644 --- a/test/functional/boards_controller_test.rb +++ b/test/functional/boards_controller_test.rb @@ -18,7 +18,7 @@ require 'boards_controller' class BoardsController; def rescue_action(e) raise e end; end class BoardsControllerTest < ActionController::TestCase - fixtures :projects, :users, :members, :member_roles, :roles, :boards, :messages, :enabled_modules + fixtures :all def setup @controller = BoardsController.new diff --git a/test/functional/custom_fields_controller_test.rb b/test/functional/custom_fields_controller_test.rb index 06ac967d7f..c08c0dbf32 100644 --- a/test/functional/custom_fields_controller_test.rb +++ b/test/functional/custom_fields_controller_test.rb @@ -19,10 +19,7 @@ require 'custom_fields_controller' class CustomFieldsController; def rescue_action(e) raise e end; end class CustomFieldsControllerTest < ActionController::TestCase - fixtures :custom_fields, - :custom_field_translations, - :trackers, - :users + fixtures :all def setup @controller = CustomFieldsController.new diff --git a/test/functional/documents_controller_test.rb b/test/functional/documents_controller_test.rb index 3c0cd6c5d4..615ff8fd61 100644 --- a/test/functional/documents_controller_test.rb +++ b/test/functional/documents_controller_test.rb @@ -18,7 +18,7 @@ require 'documents_controller' class DocumentsController; def rescue_action(e) raise e end; end class DocumentsControllerTest < ActionController::TestCase - fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules, :documents, :enumerations + fixtures :all def setup @controller = DocumentsController.new diff --git a/test/functional/enumerations_controller_test.rb b/test/functional/enumerations_controller_test.rb index 2093433d77..093937c585 100644 --- a/test/functional/enumerations_controller_test.rb +++ b/test/functional/enumerations_controller_test.rb @@ -18,7 +18,7 @@ require 'enumerations_controller' class EnumerationsController; def rescue_action(e) raise e end; end class EnumerationsControllerTest < ActionController::TestCase - fixtures :enumerations, :issues, :users + fixtures :all def setup @controller = EnumerationsController.new diff --git a/test/functional/groups_controller_test.rb b/test/functional/groups_controller_test.rb index 55a3b0e9a7..32d8d26b61 100644 --- a/test/functional/groups_controller_test.rb +++ b/test/functional/groups_controller_test.rb @@ -18,7 +18,7 @@ require 'groups_controller' class GroupsController; def rescue_action(e) raise e end; end class GroupsControllerTest < ActionController::TestCase - fixtures :projects, :users, :members, :roles, :member_roles, :group_users + fixtures :all def setup @controller = GroupsController.new diff --git a/test/functional/issue_categories_controller_test.rb b/test/functional/issue_categories_controller_test.rb index de85aa39da..f58193a837 100644 --- a/test/functional/issue_categories_controller_test.rb +++ b/test/functional/issue_categories_controller_test.rb @@ -18,7 +18,7 @@ require 'issue_categories_controller' class IssueCategoriesController; def rescue_action(e) raise e end; end class IssueCategoriesControllerTest < ActionController::TestCase - fixtures :projects, :users, :members, :member_roles, :roles, :enabled_modules, :issues, :issue_categories + fixtures :all def setup @controller = IssueCategoriesController.new diff --git a/test/functional/issue_relations_controller_test.rb b/test/functional/issue_relations_controller_test.rb index aba90e8eab..034096b47b 100644 --- a/test/functional/issue_relations_controller_test.rb +++ b/test/functional/issue_relations_controller_test.rb @@ -20,17 +20,7 @@ class IssueRelationsController; def rescue_action(e) raise e end; end class IssueRelationsControllerTest < ActionController::TestCase - fixtures :projects, - :users, - :roles, - :members, - :member_roles, - :issues, - :issue_statuses, - :issue_relations, - :enabled_modules, - :enumerations, - :trackers + fixtures :all def setup @controller = IssueRelationsController.new diff --git a/test/functional/issue_statuses_controller_test.rb b/test/functional/issue_statuses_controller_test.rb index f02a8a3ccf..770c265f81 100644 --- a/test/functional/issue_statuses_controller_test.rb +++ b/test/functional/issue_statuses_controller_test.rb @@ -20,7 +20,7 @@ class IssueStatusesController; def rescue_action(e) raise e end; end class IssueStatusesControllerTest < ActionController::TestCase - fixtures :issue_statuses, :issues + fixtures :all def setup super diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index d0f60ad4ba..f8dd1a1891 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -18,30 +18,7 @@ require 'issues_controller' class IssuesController; def rescue_action(e) raise e end; end class IssuesControllerTest < ActionController::TestCase - fixtures :projects, - :users, - :roles, - :members, - :member_roles, - :issues, - :issue_statuses, - :versions, - :trackers, - :projects_trackers, - :issue_categories, - :enabled_modules, - :enumerations, - :attachments, - :workflows, - :custom_fields, - :custom_field_translations, - :custom_values, - :custom_fields_projects, - :custom_fields_trackers, - :time_entries, - :journals, - :queries, - :watchers + fixtures :all def setup @controller = IssuesController.new diff --git a/test/functional/issues_controller_transaction_test.rb b/test/functional/issues_controller_transaction_test.rb index 0146f2f6d4..b4ab0fcbc4 100644 --- a/test/functional/issues_controller_transaction_test.rb +++ b/test/functional/issues_controller_transaction_test.rb @@ -18,29 +18,7 @@ require 'issues_controller' class IssuesController; def rescue_action(e) raise e end; end class IssuesControllerTransactionTest < ActionController::TestCase - fixtures :projects, - :users, - :roles, - :members, - :member_roles, - :issues, - :issue_statuses, - :versions, - :trackers, - :projects_trackers, - :issue_categories, - :enabled_modules, - :enumerations, - :attachments, - :workflows, - :custom_fields, - :custom_field_translations, - :custom_values, - :custom_fields_projects, - :custom_fields_trackers, - :time_entries, - :journals, - :queries + fixtures :all self.use_transactional_fixtures = false diff --git a/test/functional/journals_controller_test.rb b/test/functional/journals_controller_test.rb index f518c3fb32..a821088032 100644 --- a/test/functional/journals_controller_test.rb +++ b/test/functional/journals_controller_test.rb @@ -18,10 +18,7 @@ require 'journals_controller' class JournalsController; def rescue_action(e) raise e end; end class JournalsControllerTest < ActionController::TestCase - fixtures :projects, :users, :members, :member_roles, - :roles, :issues, :journals, :enabled_modules, - :trackers, :issue_statuses, :enumerations, - :custom_fields, :custom_field_translations, :custom_values, :custom_fields_projects + fixtures :all def setup @controller = JournalsController.new diff --git a/test/functional/mail_handler_controller_test.rb b/test/functional/mail_handler_controller_test.rb index 46e0940b16..fd54e75c25 100644 --- a/test/functional/mail_handler_controller_test.rb +++ b/test/functional/mail_handler_controller_test.rb @@ -18,7 +18,7 @@ require 'mail_handler_controller' class MailHandlerController; def rescue_action(e) raise e end; end class MailHandlerControllerTest < ActionController::TestCase - fixtures :users, :projects, :enabled_modules, :roles, :members, :member_roles, :issues, :issue_statuses, :trackers, :enumerations + fixtures :all FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures/mail_handler' diff --git a/test/functional/members_controller_test.rb b/test/functional/members_controller_test.rb index 9bfa7c8ab6..a1cb73a79c 100644 --- a/test/functional/members_controller_test.rb +++ b/test/functional/members_controller_test.rb @@ -19,7 +19,7 @@ class MembersController; def rescue_action(e) raise e end; end class MembersControllerTest < ActionController::TestCase - fixtures :projects, :members, :member_roles, :roles, :users + fixtures :all def setup @controller = MembersController.new diff --git a/test/functional/messages_controller_test.rb b/test/functional/messages_controller_test.rb index 9891c8e629..29233b857e 100644 --- a/test/functional/messages_controller_test.rb +++ b/test/functional/messages_controller_test.rb @@ -18,7 +18,7 @@ require 'messages_controller' class MessagesController; def rescue_action(e) raise e end; end class MessagesControllerTest < ActionController::TestCase - fixtures :projects, :users, :members, :member_roles, :roles, :boards, :messages, :enabled_modules + fixtures :all def setup @controller = MessagesController.new diff --git a/test/functional/my_controller_test.rb b/test/functional/my_controller_test.rb index c764a93684..3541789675 100644 --- a/test/functional/my_controller_test.rb +++ b/test/functional/my_controller_test.rb @@ -18,9 +18,7 @@ require 'my_controller' class MyController; def rescue_action(e) raise e end; end class MyControllerTest < ActionController::TestCase - fixtures :users, :user_preferences, :roles, :projects, - :issues, :issue_statuses, :trackers, :enumerations, - :custom_fields, :custom_field_translations + fixtures :all def setup @controller = MyController.new diff --git a/test/functional/news/comments_controller_test.rb b/test/functional/news/comments_controller_test.rb index a7bd73b599..ff95598341 100644 --- a/test/functional/news/comments_controller_test.rb +++ b/test/functional/news/comments_controller_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../../test_helper', __FILE__) class News::CommentsControllerTest < ActionController::TestCase - fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules, :news, :comments + fixtures :all def setup User.current = nil diff --git a/test/functional/news_controller_test.rb b/test/functional/news_controller_test.rb index c19b7b8e94..aca5dc572d 100644 --- a/test/functional/news_controller_test.rb +++ b/test/functional/news_controller_test.rb @@ -18,7 +18,7 @@ require 'news_controller' class NewsController; def rescue_action(e) raise e end; end class NewsControllerTest < ActionController::TestCase - fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules, :news, :comments + fixtures :all def setup @controller = NewsController.new diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index b665d0152a..b81a97a9f2 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -20,12 +20,7 @@ class ProjectsController; def rescue_action(e) raise e end; end class ProjectsControllerTest < ActionController::TestCase include MiniTest::Assertions # refute - fixtures :projects, :versions, :users, :roles, :members, - :member_roles, :issues, :journals, - :trackers, :projects_trackers, :issue_statuses, - :enabled_modules, :enumerations, :boards, :messages, - :attachments, :custom_fields, :custom_field_translations, - :custom_values, :time_entries + fixtures :all def setup @controller = ProjectsController.new diff --git a/test/functional/queries_controller_test.rb b/test/functional/queries_controller_test.rb index 4523d33489..e767c37720 100644 --- a/test/functional/queries_controller_test.rb +++ b/test/functional/queries_controller_test.rb @@ -18,10 +18,7 @@ require 'queries_controller' class QueriesController; def rescue_action(e) raise e end; end class QueriesControllerTest < ActionController::TestCase - fixtures :projects, :users, :members, :member_roles, - :roles, :trackers, :issue_statuses, :issue_categories, - :enumerations, :issues, - :custom_fields, :custom_field_translations, :custom_values, :queries + fixtures :all def setup @controller = QueriesController.new diff --git a/test/functional/repositories_controller_test.rb b/test/functional/repositories_controller_test.rb index 04839d3449..865ec40a44 100644 --- a/test/functional/repositories_controller_test.rb +++ b/test/functional/repositories_controller_test.rb @@ -18,10 +18,7 @@ require 'repositories_controller' class RepositoriesController; def rescue_action(e) raise e end; end class RepositoriesControllerTest < ActionController::TestCase - fixtures :projects, :users, :roles, :members, :member_roles, - :repositories, :issues, :issue_statuses, :changesets, :changes, - :issue_categories, :enumerations, - :custom_fields, :custom_field_translations, :custom_values, :trackers + fixtures :all def setup @controller = RepositoriesController.new diff --git a/test/functional/repositories_filesystem_controller_test.rb b/test/functional/repositories_filesystem_controller_test.rb index af79e1e344..db98bd1143 100644 --- a/test/functional/repositories_filesystem_controller_test.rb +++ b/test/functional/repositories_filesystem_controller_test.rb @@ -18,7 +18,7 @@ require 'repositories_controller' class RepositoriesController; def rescue_action(e) raise e end; end class RepositoriesFilesystemControllerTest < ActionController::TestCase - fixtures :projects, :users, :roles, :members, :member_roles, :repositories, :enabled_modules + fixtures :all # No '..' in the repository path REPOSITORY_PATH = Rails.root.to_s.gsub(%r{config\/\.\.}, '') + '/tmp/test/filesystem_repository' diff --git a/test/functional/repositories_git_controller_test.rb b/test/functional/repositories_git_controller_test.rb index de0eef89c9..9a94c096df 100644 --- a/test/functional/repositories_git_controller_test.rb +++ b/test/functional/repositories_git_controller_test.rb @@ -18,7 +18,7 @@ require 'repositories_controller' class RepositoriesController; def rescue_action(e) raise e end; end class RepositoriesGitControllerTest < ActionController::TestCase - fixtures :projects, :users, :roles, :members, :member_roles, :repositories, :enabled_modules + fixtures :all # No '..' in the repository path REPOSITORY_PATH = Rails.root.to_s.gsub(%r{config\/\.\.}, '') + '/tmp/test/git_repository' diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb index a00e42030f..1e87617516 100644 --- a/test/functional/repositories_subversion_controller_test.rb +++ b/test/functional/repositories_subversion_controller_test.rb @@ -18,10 +18,7 @@ require 'repositories_controller' class RepositoriesController; def rescue_action(e) raise e end; end class RepositoriesSubversionControllerTest < ActionController::TestCase - fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules, - :repositories, :issues, :issue_statuses, :changesets, :changes, - :issue_categories, :enumerations, :custom_fields, :custom_field_translations, - :custom_values, :trackers + fixtures :all PRJ_ID = 3 diff --git a/test/functional/roles_controller_test.rb b/test/functional/roles_controller_test.rb index 16abb9b030..a2fe93fed0 100644 --- a/test/functional/roles_controller_test.rb +++ b/test/functional/roles_controller_test.rb @@ -18,7 +18,7 @@ require 'roles_controller' class RolesController; def rescue_action(e) raise e end; end class RolesControllerTest < ActionController::TestCase - fixtures :roles, :users, :members, :member_roles, :workflows, :trackers + fixtures :all def setup @controller = RolesController.new diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb index 38435ddedb..018961cc15 100644 --- a/test/functional/search_controller_test.rb +++ b/test/functional/search_controller_test.rb @@ -19,11 +19,7 @@ require 'search_controller' class SearchController; def rescue_action(e) raise e end; end class SearchControllerTest < ActionController::TestCase - fixtures :projects, :enabled_modules, :roles, :users, :members, :member_roles, - :issues, :trackers, :issue_statuses, - :custom_fields, :custom_field_translations, - :custom_values, - :repositories, :changesets + fixtures :all def setup @controller = SearchController.new diff --git a/test/functional/settings_controller_test.rb b/test/functional/settings_controller_test.rb index c9d05a1eed..ffd15d3e54 100644 --- a/test/functional/settings_controller_test.rb +++ b/test/functional/settings_controller_test.rb @@ -19,7 +19,7 @@ require 'settings_controller' class SettingsController; def rescue_action(e) raise e end; end class SettingsControllerTest < ActionController::TestCase - fixtures :users + fixtures :all def setup @controller = SettingsController.new diff --git a/test/functional/sys_controller_test.rb b/test/functional/sys_controller_test.rb index 09f684aa0a..ee25979c25 100644 --- a/test/functional/sys_controller_test.rb +++ b/test/functional/sys_controller_test.rb @@ -20,7 +20,7 @@ require 'mocha/setup' class SysController; def rescue_action(e) raise e end; end class SysControllerTest < ActionController::TestCase - fixtures :projects, :repositories, :enabled_modules + fixtures :all def setup @controller = SysController.new diff --git a/test/functional/time_entries/reports_controller_test.rb b/test/functional/time_entries/reports_controller_test.rb index 3c55721388..7a3bcff2e4 100644 --- a/test/functional/time_entries/reports_controller_test.rb +++ b/test/functional/time_entries/reports_controller_test.rb @@ -15,12 +15,7 @@ require File.expand_path('../../../test_helper', __FILE__) class TimeEntries::ReportsControllerTest < ActionController::TestCase - fixtures :projects, :enabled_modules, :roles, - :members, :member_roles, :issues, - :time_entries, :users, :trackers, - :enumerations, :issue_statuses, - :custom_fields, :custom_field_translations, - :custom_values + fixtures :all def test_report_at_project_level get :show, :project_id => 'ecookbook' diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index babeff2028..64d3223145 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -19,7 +19,7 @@ require 'timelog_controller' class TimelogController; def rescue_action(e) raise e end; end class TimelogControllerTest < ActionController::TestCase - fixtures :projects, :enabled_modules, :roles, :members, :member_roles, :issues, :time_entries, :users, :trackers, :enumerations, :issue_statuses, :custom_fields, :custom_values + fixtures :all def setup @controller = TimelogController.new diff --git a/test/functional/trackers_controller_test.rb b/test/functional/trackers_controller_test.rb index 0fb87ea493..32d785d167 100644 --- a/test/functional/trackers_controller_test.rb +++ b/test/functional/trackers_controller_test.rb @@ -18,13 +18,7 @@ require 'trackers_controller' class TrackersController; def rescue_action(e) raise e end; end class TrackersControllerTest < ActionController::TestCase - fixtures :trackers, - :projects, - :projects_trackers, - :users, - :issues, - :custom_fields, - :custom_field_translations + fixtures :all def setup @controller = TrackersController.new diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb index baec05773e..4265b2a34e 100644 --- a/test/functional/users_controller_test.rb +++ b/test/functional/users_controller_test.rb @@ -21,16 +21,7 @@ class UsersController; def rescue_action(e) raise e end; end class UsersControllerTest < ActionController::TestCase include Redmine::I18n - fixtures :users, - :projects, - :members, - :member_roles, - :roles, - :auth_sources, - :custom_fields, - :custom_field_translations, - :custom_values, - :group_users + fixtures :all def setup @controller = UsersController.new diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb index f71a205902..691224ddec 100644 --- a/test/functional/versions_controller_test.rb +++ b/test/functional/versions_controller_test.rb @@ -19,16 +19,7 @@ require 'versions_controller' class VersionsController; def rescue_action(e) raise e end; end class VersionsControllerTest < ActionController::TestCase - fixtures :projects, - :versions, - :issues, - :users, - :roles, - :members, - :member_roles, - :enabled_modules, - :issue_statuses, - :enumerations + fixtures :all def setup @controller = VersionsController.new diff --git a/test/functional/watchers_controller_test.rb b/test/functional/watchers_controller_test.rb index eadbb2cee8..44c9aa4c23 100644 --- a/test/functional/watchers_controller_test.rb +++ b/test/functional/watchers_controller_test.rb @@ -18,8 +18,7 @@ require 'watchers_controller' class WatchersController; def rescue_action(e) raise e end; end class WatchersControllerTest < ActionController::TestCase - fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules, - :issues, :trackers, :projects_trackers, :issue_statuses, :enumerations, :watchers + fixtures :all def setup @controller = WatchersController.new diff --git a/test/functional/welcome_controller_test.rb b/test/functional/welcome_controller_test.rb index 388600887b..543214e646 100644 --- a/test/functional/welcome_controller_test.rb +++ b/test/functional/welcome_controller_test.rb @@ -18,9 +18,7 @@ require 'welcome_controller' class WelcomeController; def rescue_action(e) raise e end; end class WelcomeControllerTest < ActionController::TestCase - fixtures :projects, - :news, - :users + fixtures :all def setup @controller = WelcomeController.new diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index 6eeeb3bbc9..02a0acfdd5 100644 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -18,7 +18,7 @@ require 'wiki_controller' class WikiController; def rescue_action(e) raise e end; end class WikiControllerTest < ActionController::TestCase - fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules, :wikis, :wiki_pages, :wiki_contents, :journals, :attachments + fixtures :all def setup @controller = WikiController.new diff --git a/test/functional/wikis_controller_test.rb b/test/functional/wikis_controller_test.rb index 763129c7cb..8c2b6c542a 100644 --- a/test/functional/wikis_controller_test.rb +++ b/test/functional/wikis_controller_test.rb @@ -18,7 +18,7 @@ require 'wikis_controller' class WikisController; def rescue_action(e) raise e end; end class WikisControllerTest < ActionController::TestCase - fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules, :wikis + fixtures :all def setup @controller = WikisController.new diff --git a/test/functional/workflows_controller_test.rb b/test/functional/workflows_controller_test.rb index daf061afd6..081158ac74 100644 --- a/test/functional/workflows_controller_test.rb +++ b/test/functional/workflows_controller_test.rb @@ -18,7 +18,7 @@ require 'workflows_controller' class WorkflowsController; def rescue_action(e) raise e end; end class WorkflowsControllerTest < ActionController::TestCase - fixtures :roles, :trackers, :workflows, :users, :issue_statuses + fixtures :all def setup @controller = WorkflowsController.new diff --git a/test/integration/account_test.rb b/test/integration/account_test.rb index 49159fa671..0613f8a823 100644 --- a/test/integration/account_test.rb +++ b/test/integration/account_test.rb @@ -20,7 +20,7 @@ rescue end class AccountTest < ActionDispatch::IntegrationTest - fixtures :users, :roles + fixtures :all # Replace this with your real tests. def test_login diff --git a/test/integration/api_test/issues_test.rb b/test/integration/api_test/issues_test.rb index aaf16768f5..e96fdb353f 100644 --- a/test/integration/api_test/issues_test.rb +++ b/test/integration/api_test/issues_test.rb @@ -14,29 +14,7 @@ require File.expand_path('../../../test_helper', __FILE__) class ApiTest::IssuesTest < ActionController::IntegrationTest - fixtures :projects, - :users, - :roles, - :members, - :member_roles, - :issues, - :issue_statuses, - :versions, - :trackers, - :projects_trackers, - :issue_categories, - :enabled_modules, - :enumerations, - :attachments, - :workflows, - :custom_fields, - :custom_field_translations, - :custom_values, - :custom_fields_projects, - :custom_fields_trackers, - :time_entries, - :journals, - :queries + fixtures :all def setup Setting.rest_api_enabled = '1' diff --git a/test/integration/api_test/projects_test.rb b/test/integration/api_test/projects_test.rb index f0dc276bd2..f0cc5e1c7f 100644 --- a/test/integration/api_test/projects_test.rb +++ b/test/integration/api_test/projects_test.rb @@ -14,26 +14,7 @@ require File.expand_path('../../../test_helper', __FILE__) class ApiTest::ProjectsTest < ActionController::IntegrationTest - fixtures :projects, - :versions, - :users, - :roles, - :members, - :member_roles, - :issues, - :journals, - :trackers, - :projects_trackers, - :issue_statuses, - :enabled_modules, - :enumerations, - :boards, - :messages, - :attachments, - :custom_fields, - :custom_field_translations, - :custom_values, - :time_entries + fixtures :all def setup Setting.rest_api_enabled = '1' diff --git a/test/integration/api_test/users_test.rb b/test/integration/api_test/users_test.rb index f958d57679..342ce7cf57 100644 --- a/test/integration/api_test/users_test.rb +++ b/test/integration/api_test/users_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../../test_helper', __FILE__) class ApiTest::UsersTest < ActionController::IntegrationTest - fixtures :users + fixtures :all def setup Setting.rest_api_enabled = '1' diff --git a/test/integration/issues_test.rb b/test/integration/issues_test.rb index 5b8274c4f7..5e60b615bb 100644 --- a/test/integration/issues_test.rb +++ b/test/integration/issues_test.rb @@ -14,21 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class IssuesTest < ActionController::IntegrationTest - fixtures :projects, - :users, - :roles, - :members, - :member_roles, - :trackers, - :projects_trackers, - :enabled_modules, - :issue_statuses, - :issues, - :enumerations, - :custom_fields, - :custom_field_translations, - :custom_values, - :custom_fields_trackers + fixtures :all # create an issue def test_add_issue diff --git a/test/integration/projects_test.rb b/test/integration/projects_test.rb index 0ffdf0a580..345b06efc1 100644 --- a/test/integration/projects_test.rb +++ b/test/integration/projects_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class ProjectsTest < ActionController::IntegrationTest - fixtures :projects, :users, :members + fixtures :all def test_archive_project subproject = Project.find(1).children.first diff --git a/test/unit/activity_test.rb b/test/unit/activity_test.rb index 02216893dc..56312906ee 100644 --- a/test/unit/activity_test.rb +++ b/test/unit/activity_test.rb @@ -14,8 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class ActivityTest < ActiveSupport::TestCase - fixtures :projects, :versions, :attachments, :users, :roles, :members, :member_roles, :issues, :journals, - :trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations, :boards, :messages + fixtures :all def setup @project = Project.find(1) diff --git a/test/unit/attachment_test.rb b/test/unit/attachment_test.rb index 7351addc31..a128955731 100644 --- a/test/unit/attachment_test.rb +++ b/test/unit/attachment_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class AttachmentTest < ActiveSupport::TestCase - fixtures :issues, :users + fixtures :all def setup end diff --git a/test/unit/board_test.rb b/test/unit/board_test.rb index 4a31e11bbe..6332fac349 100644 --- a/test/unit/board_test.rb +++ b/test/unit/board_test.rb @@ -15,7 +15,7 @@ require File.expand_path('../../test_helper', __FILE__) class BoardTest < ActiveSupport::TestCase - fixtures :projects, :boards, :messages, :attachments, :watchers + fixtures :all def setup @project = Project.find(1) diff --git a/test/unit/changeset_test.rb b/test/unit/changeset_test.rb index a8436f9dd1..daa801233f 100644 --- a/test/unit/changeset_test.rb +++ b/test/unit/changeset_test.rb @@ -14,10 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class ChangesetTest < ActiveSupport::TestCase - fixtures :projects, :repositories, :issues, :issue_statuses, - :changesets, :changes, :issue_categories, :enumerations, - :custom_fields, :custom_field_translations, :custom_values, - :users, :members, :member_roles, :trackers + fixtures :all def setup super diff --git a/test/unit/document_test.rb b/test/unit/document_test.rb index 8e7000b862..0c56f80861 100644 --- a/test/unit/document_test.rb +++ b/test/unit/document_test.rb @@ -16,7 +16,7 @@ require_relative '../test_helper' class DocumentTest < ActiveSupport::TestCase include MiniTest::Assertions # refute - #fixtures :projects, :enumerations, :documents, :attachments + fixtures :all def setup @documentation_category = FactoryGirl.create :document_category, :name => 'User documentation' diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 02cba603e8..ef9ebf6b3f 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -14,14 +14,7 @@ require File.expand_path('../../../test_helper', __FILE__) class ApplicationHelperTest < ActionView::TestCase - - fixtures :projects, :roles, :enabled_modules, :users, - :repositories, :changesets, - :trackers, :issue_statuses, :issues, :versions, :documents, - :wikis, :wiki_pages, :wiki_contents, - :boards, :messages, - :attachments, - :enumerations + fixtures :all def setup super diff --git a/test/unit/helpers/timelog_helper_test.rb b/test/unit/helpers/timelog_helper_test.rb index f8db394087..2059c8329d 100644 --- a/test/unit/helpers/timelog_helper_test.rb +++ b/test/unit/helpers/timelog_helper_test.rb @@ -18,13 +18,7 @@ class TimelogHelperTest < HelperTestCase include ActionView::Helpers::TextHelper include ActionView::Helpers::DateHelper - fixtures :projects, :roles, :enabled_modules, :users, - :repositories, :changesets, - :trackers, :issue_statuses, :issues, :versions, :documents, - :wikis, :wiki_pages, :wiki_contents, - :boards, :messages, - :attachments, - :enumerations + fixtures :all def setup super diff --git a/test/unit/issue_nested_set_test.rb b/test/unit/issue_nested_set_test.rb index 415bbf30b9..7e69598b63 100644 --- a/test/unit/issue_nested_set_test.rb +++ b/test/unit/issue_nested_set_test.rb @@ -16,15 +16,7 @@ require File.expand_path('../../test_helper', __FILE__) class IssueNestedSetTest < ActiveSupport::TestCase include MiniTest::Assertions # refute - fixtures :projects, :users, :members, :member_roles, :roles, - :trackers, :projects_trackers, - :versions, - :issue_statuses, :issue_categories, :issue_relations, :workflows, - :enumerations, - :issues, - :custom_fields, :custom_field_translations, - :custom_fields_projects, :custom_fields_trackers, :custom_values, - :time_entries + fixtures :all self.use_transactional_fixtures = false diff --git a/test/unit/issue_priority_test.rb b/test/unit/issue_priority_test.rb index 5898e2072a..20298db6ab 100644 --- a/test/unit/issue_priority_test.rb +++ b/test/unit/issue_priority_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class IssuePriorityTest < ActiveSupport::TestCase - fixtures :enumerations, :issues + fixtures :all def test_should_be_an_enumeration assert IssuePriority.ancestors.include?(Enumeration) diff --git a/test/unit/issue_relation_test.rb b/test/unit/issue_relation_test.rb index be46d06efc..705c0b87d9 100644 --- a/test/unit/issue_relation_test.rb +++ b/test/unit/issue_relation_test.rb @@ -16,7 +16,7 @@ require File.expand_path('../../test_helper', __FILE__) class IssueRelationTest < ActiveSupport::TestCase include MiniTest::Assertions # refute - fixtures :issue_relations, :issues + fixtures :all def test_create from = Issue.find(1) diff --git a/test/unit/issue_status_test.rb b/test/unit/issue_status_test.rb index fc06ce1894..ab9e8c6373 100644 --- a/test/unit/issue_status_test.rb +++ b/test/unit/issue_status_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class IssueStatusTest < ActiveSupport::TestCase - fixtures :issue_statuses, :issues, :roles, :trackers + fixtures :all def test_create status = IssueStatus.new :name => "Assigned" diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index 6fea56633f..af61f43ee6 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -16,19 +16,7 @@ require File.expand_path('../../test_helper', __FILE__) class IssueTest < ActiveSupport::TestCase include MiniTest::Assertions # refute - fixtures :projects, :users, :members, :member_roles, :roles, - :trackers, :projects_trackers, - :enabled_modules, - :versions, - :issue_statuses, :issue_categories, :issue_relations, :workflows, - :enumerations, - :issues, - :custom_fields, - :custom_field_translations, - :custom_fields_projects, - :custom_fields_trackers, - :custom_values, - :time_entries + fixtures :all def test_create issue = Issue.new.tap do |i| diff --git a/test/unit/journal_test.rb b/test/unit/journal_test.rb index 4154a5cab1..9698deb826 100644 --- a/test/unit/journal_test.rb +++ b/test/unit/journal_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class JournalTest < ActiveSupport::TestCase - fixtures :issues, :issue_statuses, :journals, :enumerations, :projects, :users, :trackers, :watchers, :members, :member_roles, :roles, :enabled_modules + fixtures :all def setup @journal = IssueJournal.find(1) diff --git a/test/unit/ldap_auth_source_test.rb b/test/unit/ldap_auth_source_test.rb index 263d687c5b..afaa78c9f3 100644 --- a/test/unit/ldap_auth_source_test.rb +++ b/test/unit/ldap_auth_source_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class LdapAuthSourceTest < ActiveSupport::TestCase - fixtures :auth_sources + fixtures :all def setup end diff --git a/test/unit/lib/redmine/menu_manager/menu_helper_test.rb b/test/unit/lib/redmine/menu_manager/menu_helper_test.rb index 6d4496288f..451558f2d9 100644 --- a/test/unit/lib/redmine/menu_manager/menu_helper_test.rb +++ b/test/unit/lib/redmine/menu_manager/menu_helper_test.rb @@ -18,7 +18,7 @@ require File.expand_path('../../../../../test_helper', __FILE__) class Redmine::MenuManager::MenuHelperTest < HelperTestCase include Redmine::MenuManager::MenuHelper include ActionDispatch::Assertions::SelectorAssertions - fixtures :users, :members, :projects, :enabled_modules + fixtures :all # Used by assert_select def html_document diff --git a/test/unit/news_test.rb b/test/unit/news_test.rb index de2c2b8564..e091381176 100644 --- a/test/unit/news_test.rb +++ b/test/unit/news_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class NewsTest < ActiveSupport::TestCase - fixtures :projects, :users, :roles, :members, :member_roles, :enabled_modules, :news + fixtures :all def valid_news { :title => 'Test news', :description => 'Lorem ipsum etc', :author => User.find(:first) } diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb index 19ac5dce66..2630852983 100644 --- a/test/unit/query_test.rb +++ b/test/unit/query_test.rb @@ -14,11 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class QueryTest < ActiveSupport::TestCase - fixtures :projects, :enabled_modules, :users, - :members, :member_roles, :roles, :trackers, - :issue_statuses, :issue_categories, :enumerations, - :issues, :watchers, :versions, :queries, - :custom_fields, :custom_field_translations, :custom_values + fixtures :all def test_custom_fields_for_all_projects_should_be_available_in_global_queries query = Query.new(:project => nil, :name => '_') diff --git a/test/unit/repository_filesystem_test.rb b/test/unit/repository_filesystem_test.rb index 6fcea859f4..befe7534b5 100644 --- a/test/unit/repository_filesystem_test.rb +++ b/test/unit/repository_filesystem_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class RepositoryFilesystemTest < ActiveSupport::TestCase - fixtures :projects + fixtures :all # No '..' in the repository path REPOSITORY_PATH = Rails.root.to_s.gsub(%r{config\/\.\.}, '') + '/tmp/test/filesystem_repository' diff --git a/test/unit/repository_git_test.rb b/test/unit/repository_git_test.rb index 9b8534eb2d..c05c8d51e9 100644 --- a/test/unit/repository_git_test.rb +++ b/test/unit/repository_git_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class RepositoryGitTest < ActiveSupport::TestCase - fixtures :projects, :repositories, :enabled_modules, :users, :roles + fixtures :all # No '..' in the repository path REPOSITORY_PATH = Rails.root.to_s.gsub(%r{config\/\.\.}, '') + '/tmp/test/git_repository' diff --git a/test/unit/repository_subversion_test.rb b/test/unit/repository_subversion_test.rb index 5a077ad9e4..6cb6e0b0e7 100644 --- a/test/unit/repository_subversion_test.rb +++ b/test/unit/repository_subversion_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class RepositorySubversionTest < ActiveSupport::TestCase - fixtures :projects, :repositories, :enabled_modules, :users, :roles + fixtures :all def setup @project = Project.find(3) diff --git a/test/unit/role_test.rb b/test/unit/role_test.rb index 6aeed63df1..54d9123763 100644 --- a/test/unit/role_test.rb +++ b/test/unit/role_test.rb @@ -14,7 +14,7 @@ require 'test_helper' class RoleTest < ActiveSupport::TestCase - fixtures :roles, :workflows, :trackers + fixtures :all def test_copy_workflows source = Role.find(1) diff --git a/test/unit/search_test.rb b/test/unit/search_test.rb index b861d22f0b..d97ad8419e 100644 --- a/test/unit/search_test.rb +++ b/test/unit/search_test.rb @@ -14,17 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class SearchTest < ActiveSupport::TestCase - fixtures :users, - :members, - :member_roles, - :projects, - :roles, - :enabled_modules, - :issues, - :trackers, - :journals, - :repositories, - :changesets + fixtures :all def setup @project = Project.find(1) diff --git a/test/unit/time_entry_activity_test.rb b/test/unit/time_entry_activity_test.rb index 9a5063e9b6..76f313da2f 100644 --- a/test/unit/time_entry_activity_test.rb +++ b/test/unit/time_entry_activity_test.rb @@ -16,7 +16,7 @@ require File.expand_path('../../test_helper', __FILE__) class TimeEntryActivityTest < ActiveSupport::TestCase include MiniTest::Assertions # refute - fixtures :enumerations, :time_entries, :custom_fields, :custom_field_translations + fixtures :all def test_should_be_an_enumeration diff --git a/test/unit/time_entry_test.rb b/test/unit/time_entry_test.rb index 3599212325..7a4a25f8ee 100644 --- a/test/unit/time_entry_test.rb +++ b/test/unit/time_entry_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class TimeEntryTest < ActiveSupport::TestCase - fixtures :issues, :projects, :users, :time_entries, :roles, :enabled_modules + fixtures :all def test_hours_format assertions = { "2" => 2.0, diff --git a/test/unit/token_test.rb b/test/unit/token_test.rb index 3ac8dedfe6..42d8c267a9 100644 --- a/test/unit/token_test.rb +++ b/test/unit/token_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class TokenTest < ActiveSupport::TestCase - fixtures :tokens, :users + fixtures :all def test_create token = Token.new diff --git a/test/unit/tracker_test.rb b/test/unit/tracker_test.rb index 9df17202e9..a3adfa012a 100644 --- a/test/unit/tracker_test.rb +++ b/test/unit/tracker_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class TrackerTest < ActiveSupport::TestCase - fixtures :trackers, :workflows, :issue_statuses, :roles + fixtures :all def test_copy_workflows source = Tracker.find(1) diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb index 52c0d9add0..31f57ab486 100644 --- a/test/unit/user_test.rb +++ b/test/unit/user_test.rb @@ -16,14 +16,7 @@ require File.expand_path('../../test_helper', __FILE__) class UserTest < ActiveSupport::TestCase include MiniTest::Assertions # refute - fixtures :users, - :members, - :projects, - :projects_trackers, - :trackers, - :roles, - :member_roles, - :auth_sources + fixtures :all def setup @admin = User.find(1) diff --git a/test/unit/version_test.rb b/test/unit/version_test.rb index 23233fadef..b653b46257 100644 --- a/test/unit/version_test.rb +++ b/test/unit/version_test.rb @@ -14,14 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class VersionTest < ActiveSupport::TestCase - fixtures :projects, - :users, - :issues, - :issue_statuses, - :trackers, - :projects_trackers, - :enumerations, - :versions + fixtures :all def setup end diff --git a/test/unit/wiki_page_test.rb b/test/unit/wiki_page_test.rb index af63052924..e9b7472360 100644 --- a/test/unit/wiki_page_test.rb +++ b/test/unit/wiki_page_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class WikiPageTest < ActiveSupport::TestCase - fixtures :projects, :wikis, :wiki_pages, :wiki_contents, :journals + fixtures :all def setup @wiki = Wiki.find(1) diff --git a/test/unit/wiki_redirect_test.rb b/test/unit/wiki_redirect_test.rb index 250d7659a3..b433f64dbd 100644 --- a/test/unit/wiki_redirect_test.rb +++ b/test/unit/wiki_redirect_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class WikiRedirectTest < ActiveSupport::TestCase - fixtures :projects, :wikis, :wiki_pages + fixtures :all def setup @wiki = Wiki.find(1) diff --git a/test/unit/wiki_test.rb b/test/unit/wiki_test.rb index e6945b3f00..8ad9f725ef 100644 --- a/test/unit/wiki_test.rb +++ b/test/unit/wiki_test.rb @@ -14,7 +14,7 @@ require File.expand_path('../../test_helper', __FILE__) class WikiTest < ActiveSupport::TestCase - fixtures :projects, :wikis, :wiki_pages, :wiki_contents, :journals + fixtures :all def test_create wiki = Wiki.new(:project => Project.find(2))