From 12964f76ed3a87c4535430ca69aac6ed388d702f Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Sat, 24 Jan 2026 04:53:35 +0000 Subject: [PATCH] Code cleanup (#43643). git-svn-id: https://svn.redmine.org/redmine/trunk@24364 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/helpers/application_helper_test.rb | 10 ---------- test/test_helper.rb | 9 +++++++++ test/unit/lib/redmine/wiki_formatting/macros_test.rb | 10 ---------- .../redmine/wiki_formatting/textile_formatter_test.rb | 11 ----------- 4 files changed, 9 insertions(+), 31 deletions(-) diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index 059aaca7d..87b57c7f2 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -22,7 +22,6 @@ require_relative '../test_helper' class ApplicationHelperTest < Redmine::HelperTest include ERB::Util include AvatarsHelper - include IconsHelper def setup super @@ -2430,13 +2429,4 @@ class ApplicationHelperTest < Redmine::HelperTest assert_equal({}, list_autofill_data_attributes) end end - - def pre_wrapper(text) - icon = sprite_icon('copy-pre-content', size: 18) - button_copy = l(:button_copy) - '
' + - icon + '' + - text + - '
' - end end diff --git a/test/test_helper.rb b/test/test_helper.rb index a59f70c85..2c026ad11 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -342,12 +342,21 @@ module Redmine class HelperTest < ActionView::TestCase include Redmine::I18n include Propshaft::Helper + include IconsHelper def setup super User.current = nil ::I18n.locale = 'en' end + + def pre_wrapper(text) + icon = sprite_icon('copy-pre-content', size: 18) + '
' + + icon + '' + + text + + '
' + end end class ControllerTest < ActionController::TestCase diff --git a/test/unit/lib/redmine/wiki_formatting/macros_test.rb b/test/unit/lib/redmine/wiki_formatting/macros_test.rb index 57c6417ef..8c3011575 100644 --- a/test/unit/lib/redmine/wiki_formatting/macros_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/macros_test.rb @@ -23,7 +23,6 @@ class Redmine::WikiFormatting::MacrosTest < Redmine::HelperTest include ActionView::Helpers::TextHelper include ActionView::Helpers::SanitizeHelper include ERB::Util - include IconsHelper extend ActionView::Helpers::SanitizeHelper::ClassMethods def setup @@ -627,15 +626,6 @@ class Redmine::WikiFormatting::MacrosTest < Redmine::HelperTest end end - def pre_wrapper(text) - icon = sprite_icon('copy-pre-content', size: 18) - button_copy = l(:button_copy) - '
' + - icon + '' + - text + - '
' - end - def test_recent_pages_macro_with_project_option_should_not_disclose_private_project project = Project.find(5) # Private project diff --git a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb index d0e26dcb4..5678067dd 100644 --- a/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb @@ -21,8 +21,6 @@ require_relative '../../../../test_helper' class Redmine::WikiFormatting::TextileFormatterTest < Redmine::HelperTest - include IconsHelper - def setup super @formatter = Redmine::WikiFormatting::Textile::Formatter @@ -825,13 +823,4 @@ class Redmine::WikiFormatting::TextileFormatterTest < Redmine::HelperTest assert_equal expected, result.first, "section content did not match" assert_equal ActiveSupport::Digest.hexdigest(expected), result.last, "section hash did not match" end - - def pre_wrapper(text) - icon = sprite_icon('copy-pre-content', size: 18) - button_copy = l(:button_copy) - '
' + - icon + '' + - text + - '
' - end end