From 3e432ecd6dfa1ae097768d4b1c6fb756cc6c22bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Fri, 14 Apr 2023 09:52:49 +0200 Subject: [PATCH] Rubocop tests --- .../attachments_controller_patch_test.rb | 2 +- .../functional/custom_workflows_controller_test.rb | 2 +- test/functional/groups_controller_patch_test.rb | 14 +++++++------- .../issue_relations_controller_patch_test.rb | 2 +- test/functional/issues_controller_patch_test.rb | 2 +- test/functional/projects_controller_patch_test.rb | 2 +- test/functional/timelog_controller_patch_test.rb | 2 +- test/functional/users_controller_patch_test.rb | 2 +- test/functional/versions_controller_patch_test.rb | 2 +- test/functional/wiki_controller_patch_test.rb | 2 +- test/unit/attachment_patch_test.rb | 2 +- test/unit/custom_workflow_mailer_test.rb | 2 +- test/unit/custom_workflow_test.rb | 2 +- test/unit/group_patch_test.rb | 2 +- test/unit/issue_patch_test.rb | 2 +- test/unit/issue_relation_patch_test.rb | 2 +- test/unit/project_patch_test.rb | 2 +- test/unit/time_entry_patch_test.rb | 2 +- test/unit/user_patch_test.rb | 2 +- test/unit/version_patch_test.rb | 2 +- test/unit/wiki_content_patch_test.rb | 2 +- test/unit/wiki_page_patch_test.rb | 2 +- 22 files changed, 28 insertions(+), 28 deletions(-) diff --git a/test/functional/attachments_controller_patch_test.rb b/test/functional/attachments_controller_patch_test.rb index aea02cc..d7ac12a 100644 --- a/test/functional/attachments_controller_patch_test.rb +++ b/test/functional/attachments_controller_patch_test.rb @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Attachment controller patch test class AttachmentsControllerPatchTest < RedmineCustomWorkflows::Test::TestCase diff --git a/test/functional/custom_workflows_controller_test.rb b/test/functional/custom_workflows_controller_test.rb index f113463..6b5643d 100644 --- a/test/functional/custom_workflows_controller_test.rb +++ b/test/functional/custom_workflows_controller_test.rb @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Custom workflows controller test class CustomWorkflowsControllerTest < RedmineCustomWorkflows::Test::TestCase diff --git a/test/functional/groups_controller_patch_test.rb b/test/functional/groups_controller_patch_test.rb index fb3f20f..36f228b 100644 --- a/test/functional/groups_controller_patch_test.rb +++ b/test/functional/groups_controller_patch_test.rb @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Group controller patch test class GroupControllerPatchTest < RedmineCustomWorkflows::Test::TestCase @@ -40,10 +40,10 @@ class GroupControllerPatchTest < RedmineCustomWorkflows::Test::TestCase assert_equal 'Custom workflow', @controller.flash[:notice] end - # def test_cw_env - # @request.headers['Referer'] = edit_group_path(id: @group10.id) - # put :update, params: { id: @group10.id, group: { name: 'Updated name' } } - # assert_redirected_to edit_group_path(id: @group10.id) - # assert_equal request.remote_ip, @controller.flash[:warning] - # end + def test_cw_env + @request.headers['Referer'] = edit_group_path(id: @group10.id) + put :update, params: { id: @group10.id, group: { name: 'Updated name' } } + assert_redirected_to edit_group_path(id: @group10.id) + assert_equal request.remote_ip, @controller.flash[:warning] + end end diff --git a/test/functional/issue_relations_controller_patch_test.rb b/test/functional/issue_relations_controller_patch_test.rb index ce46516..b498b3f 100644 --- a/test/functional/issue_relations_controller_patch_test.rb +++ b/test/functional/issue_relations_controller_patch_test.rb @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Issue relation controller patch test class IssueRelationsControllerPatchTest < RedmineCustomWorkflows::Test::TestCase diff --git a/test/functional/issues_controller_patch_test.rb b/test/functional/issues_controller_patch_test.rb index d66a120..39ec2e2 100644 --- a/test/functional/issues_controller_patch_test.rb +++ b/test/functional/issues_controller_patch_test.rb @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Issue controller patch test class IssuesControllerPatchTest < RedmineCustomWorkflows::Test::TestCase diff --git a/test/functional/projects_controller_patch_test.rb b/test/functional/projects_controller_patch_test.rb index 2a558fd..eeb8aea 100644 --- a/test/functional/projects_controller_patch_test.rb +++ b/test/functional/projects_controller_patch_test.rb @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Project controller patch test class ProjectsControllerPatchTest < RedmineCustomWorkflows::Test::TestCase diff --git a/test/functional/timelog_controller_patch_test.rb b/test/functional/timelog_controller_patch_test.rb index 5b78d7a..b7ab266 100644 --- a/test/functional/timelog_controller_patch_test.rb +++ b/test/functional/timelog_controller_patch_test.rb @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Time controller patch test class TimelogControllerPatchTest < RedmineCustomWorkflows::Test::TestCase diff --git a/test/functional/users_controller_patch_test.rb b/test/functional/users_controller_patch_test.rb index 85c15a5..a9bfcf9 100644 --- a/test/functional/users_controller_patch_test.rb +++ b/test/functional/users_controller_patch_test.rb @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Users controller patch test class UsersControllerPatchTest < RedmineCustomWorkflows::Test::TestCase diff --git a/test/functional/versions_controller_patch_test.rb b/test/functional/versions_controller_patch_test.rb index de813f3..9732c75 100644 --- a/test/functional/versions_controller_patch_test.rb +++ b/test/functional/versions_controller_patch_test.rb @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Version controller patch test class VersionsControllerPatchTest < RedmineCustomWorkflows::Test::TestCase diff --git a/test/functional/wiki_controller_patch_test.rb b/test/functional/wiki_controller_patch_test.rb index 9e44739..52d6439 100644 --- a/test/functional/wiki_controller_patch_test.rb +++ b/test/functional/wiki_controller_patch_test.rb @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Wiki controller patch test class WikiControllerPatchTest < RedmineCustomWorkflows::Test::TestCase diff --git a/test/unit/attachment_patch_test.rb b/test/unit/attachment_patch_test.rb index 00f1ae3..ee2d2dd 100644 --- a/test/unit/attachment_patch_test.rb +++ b/test/unit/attachment_patch_test.rb @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Attachment patch test class class AttachmentPatchTest < RedmineCustomWorkflows::Test::UnitTest diff --git a/test/unit/custom_workflow_mailer_test.rb b/test/unit/custom_workflow_mailer_test.rb index 4cecbde..3450a36 100644 --- a/test/unit/custom_workflow_mailer_test.rb +++ b/test/unit/custom_workflow_mailer_test.rb @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Custom mailer test class class CustomWorkflowMailerTest < RedmineCustomWorkflows::Test::UnitTest diff --git a/test/unit/custom_workflow_test.rb b/test/unit/custom_workflow_test.rb index 25eba68..e4c3af4 100644 --- a/test/unit/custom_workflow_test.rb +++ b/test/unit/custom_workflow_test.rb @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Custom workflow test class class CustomWorkflowTest < RedmineCustomWorkflows::Test::UnitTest diff --git a/test/unit/group_patch_test.rb b/test/unit/group_patch_test.rb index 9841cc7..2048e21 100644 --- a/test/unit/group_patch_test.rb +++ b/test/unit/group_patch_test.rb @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Group patch test class class GroupPatchTest < RedmineCustomWorkflows::Test::UnitTest diff --git a/test/unit/issue_patch_test.rb b/test/unit/issue_patch_test.rb index 1f89563..0681da7 100644 --- a/test/unit/issue_patch_test.rb +++ b/test/unit/issue_patch_test.rb @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Issue patch test class class IssuePatchTest < RedmineCustomWorkflows::Test::UnitTest diff --git a/test/unit/issue_relation_patch_test.rb b/test/unit/issue_relation_patch_test.rb index d645a66..cdca329 100644 --- a/test/unit/issue_relation_patch_test.rb +++ b/test/unit/issue_relation_patch_test.rb @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Issue relation patch test class class IssueRelationPatchTest < RedmineCustomWorkflows::Test::UnitTest diff --git a/test/unit/project_patch_test.rb b/test/unit/project_patch_test.rb index c46c9fe..40f0c90 100644 --- a/test/unit/project_patch_test.rb +++ b/test/unit/project_patch_test.rb @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Project patch test class class ProjectPatchTest < RedmineCustomWorkflows::Test::UnitTest diff --git a/test/unit/time_entry_patch_test.rb b/test/unit/time_entry_patch_test.rb index a731305..ce914ce 100644 --- a/test/unit/time_entry_patch_test.rb +++ b/test/unit/time_entry_patch_test.rb @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Time entry patch test class class TimeEntryPatchTest < RedmineCustomWorkflows::Test::UnitTest diff --git a/test/unit/user_patch_test.rb b/test/unit/user_patch_test.rb index 7bbe5ad..b4b4b38 100644 --- a/test/unit/user_patch_test.rb +++ b/test/unit/user_patch_test.rb @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # user patch test class class UserPatchTest < RedmineCustomWorkflows::Test::UnitTest diff --git a/test/unit/version_patch_test.rb b/test/unit/version_patch_test.rb index b6eaae5..7da583f 100644 --- a/test/unit/version_patch_test.rb +++ b/test/unit/version_patch_test.rb @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Version patch test class class VersionPatchTest < RedmineCustomWorkflows::Test::UnitTest diff --git a/test/unit/wiki_content_patch_test.rb b/test/unit/wiki_content_patch_test.rb index 16b3a0b..4d48e33 100644 --- a/test/unit/wiki_content_patch_test.rb +++ b/test/unit/wiki_content_patch_test.rb @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Wiki content patch test class class WikiContentPatchTest < RedmineCustomWorkflows::Test::UnitTest diff --git a/test/unit/wiki_page_patch_test.rb b/test/unit/wiki_page_patch_test.rb index 3632026..ffed4d9 100644 --- a/test/unit/wiki_page_patch_test.rb +++ b/test/unit/wiki_page_patch_test.rb @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -require File.expand_path('../test_helper', __dir__) +require File.expand_path('../../test_helper', __FILE__) # Wiki page test class class WikiPagePatchTest < RedmineCustomWorkflows::Test::UnitTest