Code cleanup (#43643).

git-svn-id: https://svn.redmine.org/redmine/trunk@24364 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu
2026-01-24 04:53:35 +00:00
parent cdcc702cc4
commit 12964f76ed
4 changed files with 9 additions and 31 deletions

View File

@@ -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)
'<div class="pre-wrapper" data-controller="clipboard"><a class="copy-pre-content-link icon-only" title="' + button_copy + '" data-action="clipboard#copyPre">' +
icon + '</a>' +
text +
'</div>'
end
end

View File

@@ -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)
'<div class="pre-wrapper" data-controller="clipboard"><a class="copy-pre-content-link icon-only" title="Copy" data-action="clipboard#copyPre">' +
icon + '</a>' +
text +
'</div>'
end
end
class ControllerTest < ActionController::TestCase

View File

@@ -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)
'<div class="pre-wrapper" data-controller="clipboard"><a class="copy-pre-content-link icon-only" title="' + button_copy + '" data-action="clipboard#copyPre">' +
icon + '</a>' +
text +
'</div>'
end
def test_recent_pages_macro_with_project_option_should_not_disclose_private_project
project = Project.find(5) # Private project

View File

@@ -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)
'<div class="pre-wrapper" data-controller="clipboard"><a class="copy-pre-content-link icon-only" title="' + button_copy + '" data-action="clipboard#copyPre">' +
icon + '</a>' +
text +
'</div>'
end
end