OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
bump rubocop and apply autofixes for new cops
ulferts4a94e03b045e
diff --git a/Gemfile.lock b/Gemfile.lockindex 2f08cc077f7..c2ecb061098 100644--- a/Gemfile.lock+++ b/Gemfile.lock@@ -849,14 +849,14 @@ GEMrspec-retry (0.6.2)rspec-core (> 3.3)rspec-support (3.11.1)- rubocop (1.36.0)+ rubocop (1.37.0)json (~> 2.3)parallel (~> 1.10)parser (>= 3.1.2.1)rainbow (>= 2.2.2, < 4.0)regexp_parser (>= 1.8, < 3.0)rexml (>= 3.2.5, < 4.0)- rubocop-ast (>= 1.20.1, < 2.0)+ rubocop-ast (>= 1.22.0, < 2.0)ruby-progressbar (~> 1.7)unicode-display_width (>= 1.4.0, < 3.0)rubocop-ast (1.22.0)diff --git a/app/mailers/interceptors/default_headers.rb b/app/mailers/interceptors/default_headers.rbindex b387445d8c6..d087f704b12 100644--- a/app/mailers/interceptors/default_headers.rb+++ b/app/mailers/interceptors/default_headers.rb@@ -1,10 +1,12 @@module Interceptors- class DefaultHeaders- def self.delivering_email(mail)+ module DefaultHeaders+ module_function++ def delivering_email(mail)mail.headers(default_headers)end- def self.default_headers+ def default_headers{'X-Mailer' => 'OpenProject','X-OpenProject-Host' => Setting.host_name,diff --git a/app/mailers/interceptors/do_not_send_mails_without_recipient.rb b/app/mailers/interceptors/do_not_send_mails_without_recipient.rbindex a6d4192d772..1c3e684e043 100644--- a/app/mailers/interceptors/do_not_send_mails_without_recipient.rb+++ b/app/mailers/interceptors/do_not_send_mails_without_recipient.rb@@ -1,6 +1,8 @@module Interceptors- class DoNotSendMailsWithoutRecipient- def self.delivering_email(mail)+ module DoNotSendMailsWithoutRecipient+ module_function++ def delivering_email(mail)receivers = [mail.to, mail.cc, mail.bcc]# the above fields might be empty arrays (if entries have been removed# by another interceptor) or nil, therefore checking for blank?diff --git a/app/models/custom_actions/actions/serializer.rb b/app/models/custom_actions/actions/serializer.rbindex e0b81496cc1..8184d7f5f8d 100644--- a/app/models/custom_actions/actions/serializer.rb+++ b/app/models/custom_actions/actions/serializer.rb@@ -26,8 +26,10 @@# See COPYRIGHT and LICENSE files for more details.#++-class CustomActions::Actions::Serializer- def self.load(value)+module CustomActions::Actions::Serializer+ module_function++ def load(value)return [] unless valueYAML@@ -47,7 +49,7 @@ class CustomActions::Actions::Serializerend.compactend- def self.dump(actions)+ def dump(actions)YAML::dump(actions.map { |a| [a.key, a.values.map(&:to_s)] })endenddiff --git a/app/models/repository/subversion.rb b/app/models/repository/subversion.rbindex 3a700d90b61..5cf39deb507 100644--- a/app/models/repository/subversion.rb+++ b/app/models/repository/subversion.rb@@ -87,7 +87,7 @@ class Repository::Subversion < Repository# Returns a path relative to the url of the repositorydef relative_path(path)- path.gsub(Regexp.new("^\/?#{Regexp.escape(relative_url)}\/"), '')+ path.gsub(Regexp.new("^/?#{Regexp.escape(relative_url)}/"), '')enddef fetch_changesetsdiff --git a/app/models/serializers/indifferent_hash_serializer.rb b/app/models/serializers/indifferent_hash_serializer.rbindex 7e826451f8c..0d606e72c6f 100644--- a/app/models/serializers/indifferent_hash_serializer.rb+++ b/app/models/serializers/indifferent_hash_serializer.rb@@ -26,12 +26,14 @@# See COPYRIGHT and LICENSE files for more details.#++module Serializers- class IndifferentHashSerializer- def self.dump(hash)+ module IndifferentHashSerializer+ module_function++ def dump(hash)hashend- def self.load(value)+ def load(value)hash = value.is_a?(Hash) ? value : {}hash.with_indifferent_accessenddiff --git a/app/services/authorization.rb b/app/services/authorization.rbindex 9b82541efcc..4f7d6a7f6f9 100644--- a/app/services/authorization.rb+++ b/app/services/authorization.rb@@ -26,19 +26,21 @@# See COPYRIGHT and LICENSE files for more details.#++-class Authorization+module Authorization+ module_function+# Returns all users having a certain permission within a project- def self.users(action, project)+ def users(action, project)Authorization::UserAllowedQuery.query(action, project)end# Returns all projects a user has a certain permission in- def self.projects(action, user)+ def projects(action, user)Authorization::ProjectQuery.query(user, action)end# Returns all roles a user has in a certain project or globally- def self.roles(user, project = nil)+ def roles(user, project = nil)if projectAuthorization::UserProjectRolesQuery.query(user, project)elsediff --git a/app/services/work_packages/shared/days.rb b/app/services/work_packages/shared/days.rbindex b74c722aa43..0dc6180b877 100644--- a/app/services/work_packages/shared/days.rb+++ b/app/services/work_packages/shared/days.rb@@ -28,9 +28,11 @@module WorkPackagesmodule Shared- class Days+ module Days+ module_function+# Returns the right day computation instance for the given instance.- def self.for(work_package)+ def for(work_package)work_package.ignore_non_working_days ? AllDays.new : WorkingDays.newendenddiff --git a/db/migrate/migration_utils/permission_adder.rb b/db/migrate/migration_utils/permission_adder.rbindex 049a33eb60b..2ae208f9dfe 100644--- a/db/migrate/migration_utils/permission_adder.rb+++ b/db/migrate/migration_utils/permission_adder.rb@@ -28,8 +28,10 @@module Migrationmodule MigrationUtils- class PermissionAdder- def self.add(having, add)+ module PermissionAdder+ module_function++ def add(having, add)Role.joins(:role_permissions).where(role_permissions: { permission: having.to_s })diff --git a/db/migrate/tables/base.rb b/db/migrate/tables/base.rbindex 31b0a2318ed..03e8a699c7c 100644--- a/db/migrate/tables/base.rb+++ b/db/migrate/tables/base.rb@@ -41,8 +41,8 @@ class Tables::Base{ id: :integer }end- def self.create_table(migration, &block)- migration.create_table table_name, **id_options.merge(bulk: true), &block+ def self.create_table(migration, &)+ migration.create_table table_name, **id_options.merge(bulk: true), &enddef self.table(_migration)diff --git a/lib/api/utilities/payload_representer.rb b/lib/api/utilities/payload_representer.rbindex c17cd1292cc..43e6bc68702 100644--- a/lib/api/utilities/payload_representer.rb+++ b/lib/api/utilities/payload_representer.rb@@ -62,8 +62,10 @@ module APIendend- class UnwritablePropertyFilter- def self.call(input, options)+ module UnwritablePropertyFilter+ module_function++ def call(input, options)writable_attr = options[:decorator].writable_attributesas = options[:binding][:as].()@@ -75,8 +77,10 @@ module APIendend- class LinkRenderBlock- def self.call(input, options)+ module LinkRenderBlock+ module_function++ def call(input, options)writable_attr = options[:decorator].writable_attributesinput.reject do |link|diff --git a/lib/api/utilities/query_filters_name_converter.rb b/lib/api/utilities/query_filters_name_converter.rbindex 63c0f3cc2da..050d1f9641a 100644--- a/lib/api/utilities/query_filters_name_converter.rb+++ b/lib/api/utilities/query_filters_name_converter.rb@@ -31,15 +31,15 @@ require 'api/utilities/query_filters_name_converter_context'module APImodule Utilities- class QueryFiltersNameConverter- class << self- def to_ar_name(attribute, refer_to_ids: false)- conversion_wp = ::API::Utilities::QueryFiltersNameConverterContext.new+ module QueryFiltersNameConverter+ module_function- ::API::Utilities::PropertyNameConverter.to_ar_name(attribute,- context: conversion_wp,- refer_to_ids:)- end+ def to_ar_name(attribute, refer_to_ids: false)+ conversion_wp = ::API::Utilities::QueryFiltersNameConverterContext.new++ ::API::Utilities::PropertyNameConverter.to_ar_name(attribute,+ context: conversion_wp,+ refer_to_ids:)endendenddiff --git a/lib/api/utilities/resource_link_parser.rb b/lib/api/utilities/resource_link_parser.rbindex 70e91d36890..d80bc11515a 100644--- a/lib/api/utilities/resource_link_parser.rb+++ b/lib/api/utilities/resource_link_parser.rb@@ -33,7 +33,7 @@ module API# http://tools.ietf.org/html/rfc3986#section-3.3SEGMENT_CHARACTER = '(\w|[-~!$&\'\(\)*+\.,:;=@]|%[0-9A-Fa-f]{2})'.freezeRESOURCE_REGEX =- "/api/v(?<version>\\d)/(?<namespace>[\\w\/]+)/(?<id>#{SEGMENT_CHARACTER}+)\\z".freeze+ "/api/v(?<version>\\d)/(?<namespace>[\\w/]+)/(?<id>#{SEGMENT_CHARACTER}+)\\z".freezeclass << selfdef parse(resource_link)diff --git a/lib/api/utilities/wp_property_name_converter.rb b/lib/api/utilities/wp_property_name_converter.rbindex f9eb60b06f0..1fdbb8f1b4f 100644--- a/lib/api/utilities/wp_property_name_converter.rb+++ b/lib/api/utilities/wp_property_name_converter.rb@@ -31,15 +31,15 @@ require 'api/utilities/property_name_converter_work_package_dummy'module APImodule Utilities- class WpPropertyNameConverter- class << self- def to_ar_name(attribute, refer_to_ids: false)- conversion_wp = ::API::Utilities::PropertyNameConverterWorkPackageDummy.new+ module WpPropertyNameConverter+ module_function- ::API::Utilities::PropertyNameConverter.to_ar_name(attribute,- context: conversion_wp,- refer_to_ids:)- end+ def to_ar_name(attribute, refer_to_ids: false)+ conversion_wp = ::API::Utilities::PropertyNameConverterWorkPackageDummy.new++ ::API::Utilities::PropertyNameConverter.to_ar_name(attribute,+ context: conversion_wp,+ refer_to_ids:)endendenddiff --git a/lib/api/v3/principals/principal_representer_factory.rb b/lib/api/v3/principals/principal_representer_factory.rbindex e920dcc6ce1..391fdf14c2a 100644--- a/lib/api/v3/principals/principal_representer_factory.rb+++ b/lib/api/v3/principals/principal_representer_factory.rb@@ -29,16 +29,18 @@module APImodule V3module Principals- class PrincipalRepresenterFactory+ module PrincipalRepresenterFactory+ module_function+### Create the appropriate subclass representer# for each principal entity- def self.create(model, **args)+ def create(model, **args)representer_class(model).create(model, **args)end- def self.representer_class(model)+ def representer_class(model)case modelwhen User::API::V3::Users::UserRepresenter@@ -51,7 +53,7 @@ module APIendend- def self.create_link_lambda(name, getter: "#{name}_id")+ def create_link_lambda(name, getter: "#{name}_id")->(*) {v3_path = API::V3::Principals::PrincipalType.for(represented.send(name))@@ -63,7 +65,7 @@ module API}end- def self.create_setter_lambda(name, property_name: name, namespaces: %i(groups users placeholder_users))+ def create_setter_lambda(name, property_name: name, namespaces: %i(groups users placeholder_users))->(fragment:, **) {::API::Decorators::LinkObject.new(represented,@@ -75,7 +77,7 @@ module API}end- def self.create_getter_lambda(name)+ def create_getter_lambda(name)->(*) {next unless embed_linksdiff --git a/lib/api/v3/principals/principal_type.rb b/lib/api/v3/principals/principal_type.rbindex fc115f4aa93..5a056aff1c3 100644--- a/lib/api/v3/principals/principal_type.rb+++ b/lib/api/v3/principals/principal_type.rb@@ -29,11 +29,13 @@module APImodule V3module Principals- class PrincipalType+ module PrincipalType+ module_function+### Return the appropriate API level type# that depend on the AR type of the principal passed in.- def self.for(principal)+ def for(principal)case principalwhen User:userdiff --git a/lib/api/v3/utilities/date_time_formatter.rb b/lib/api/v3/utilities/date_time_formatter.rbindex b9442a180ac..5ce26971dea 100644--- a/lib/api/v3/utilities/date_time_formatter.rb+++ b/lib/api/v3/utilities/date_time_formatter.rb@@ -29,14 +29,16 @@module APImodule V3module Utilities- class DateTimeFormatter- def self.format_date(date, allow_nil: false)+ module DateTimeFormatter+ module_function++ def format_date(date, allow_nil: false)return nil if date.nil? && allow_nildate.to_date.iso8601end- def self.parse_date(value, property_name, allow_nil: false)+ def parse_date(value, property_name, allow_nil: false)return nil if value.nil? && allow_nilbegin@@ -60,7 +62,7 @@ module APIdate_onlyend- def self.parse_datetime(value, property_name, allow_nil: false)+ def parse_datetime(value, property_name, allow_nil: false)return nil if value.nil? && allow_nilbegin@@ -74,19 +76,19 @@ module APIdate_and_timeend- def self.format_datetime(datetime, allow_nil: false)+ def format_datetime(datetime, allow_nil: false)return nil if datetime.nil? && allow_nildatetime.to_datetime.utc.iso8601end- def self.format_duration_from_hours(hours, allow_nil: false)+ def format_duration_from_hours(hours, allow_nil: false)return nil if hours.nil? && allow_nilDuration.new(seconds: hours * 3600).iso8601end- def self.parse_duration_to_hours(duration, property_name, allow_nil: false)+ def parse_duration_to_hours(duration, property_name, allow_nil: false)return nil if duration.nil? && allow_nilbegin@@ -99,7 +101,7 @@ module APIendend- def self.parse_duration_to_days(duration, property_name, allow_nil: false)+ def parse_duration_to_days(duration, property_name, allow_nil: false)return nil if duration.nil? && allow_nilparse_duration_to_hours(duration, property_name).to_i / 24diff --git a/lib/constraints/enterprise.rb b/lib/constraints/enterprise.rbindex 745348e3f7d..f9fd18c339d 100644--- a/lib/constraints/enterprise.rb+++ b/lib/constraints/enterprise.rb@@ -26,8 +26,10 @@# See COPYRIGHT and LICENSE files for more details.#++-class Enterprise- def self.matches?(_request)+module Enterprise+ module_function++ def matches?(_request)OpenProject::Configuration.ee_manager_visible?endenddiff --git a/lib/instance_finder.rb b/lib/instance_finder.rbindex 50140e38c6b..266ad7fd15f 100644--- a/lib/instance_finder.rb+++ b/lib/instance_finder.rb@@ -26,14 +26,16 @@# See COPYRIGHT and LICENSE files for more details.#++-class InstanceFinder- def self.register(model, method)+module InstanceFinder+ module_function++ def register(model, method)@model_method_map ||= {}@model_method_map[model] = methodend- def self.find(model, identifier)+ def find(model, identifier)if @model_method_map[model].nil?raise "#{model} is not registered with InstanceFinder"enddiff --git a/lib/open_project/custom_styles/color_themes.rb b/lib/open_project/custom_styles/color_themes.rbindex 8832d67f201..0ea9a142ec0 100644--- a/lib/open_project/custom_styles/color_themes.rb+++ b/lib/open_project/custom_styles/color_themes.rb@@ -27,7 +27,9 @@#++module OpenProject::CustomStyles- class ColorThemes+ module ColorThemes+ module_function+OpenProject::CustomStyles::ColorThemes::DEFAULT_THEME_NAME = 'OpenProject'.freezeTHEMES = [@@ -97,7 +99,7 @@ module OpenProject::CustomStyles}].freeze- def self.themes+ def themesTHEMESendenddiff --git a/lib/open_project/custom_styles/design.rb b/lib/open_project/custom_styles/design.rbindex d721e0a5986..40a5b70d939 100644--- a/lib/open_project/custom_styles/design.rb+++ b/lib/open_project/custom_styles/design.rb@@ -27,31 +27,33 @@#++module OpenProject::CustomStyles- class Design+ module Design+ module_function+### Returns the name of the color scheme.# To be overridden by a plugin- def self.name+ def name'OpenProject Theme'end- def self.identifier+ def identifier:core_designend- def self.overridden?+ def overridden?identifier == :core_designend### Path the favicon- def self.favicon_asset_path+ def favicon_asset_path'favicon.ico'.freezeend### Returns the keys of variables that are customizable through the design- def self.customizable_variables+ def customizable_variables%w( primary-colorprimary-color-darkalternative-colordiff --git a/lib/open_project/logging/thread_pool_context_builder.rb b/lib/open_project/logging/thread_pool_context_builder.rbindex b196b2ae677..0c9465f4845 100644--- a/lib/open_project/logging/thread_pool_context_builder.rb+++ b/lib/open_project/logging/thread_pool_context_builder.rb@@ -1,10 +1,12 @@module OpenProjectmodule Logging- class ThreadPoolContextBuilder+ module ThreadPoolContextBuilder+ module_function+### Build an object informing about current Rails connection pool# and active thread usage and their traces- def self.build!+ def build!thread_info = {}Thread.list.each_with_index do |t, i|thread_info[i] = {diff --git a/lib/open_project/plugins/module_handler.rb b/lib/open_project/plugins/module_handler.rbindex 86d0074af2d..6c05f75f33a 100644--- a/lib/open_project/plugins/module_handler.rb+++ b/lib/open_project/plugins/module_handler.rb@@ -27,14 +27,14 @@#++project_modulemodule OpenProject::Plugins- class ModuleHandler+ module ModuleHandler+ module_function+@@disabled_modules = []- class << self- def disable_modules!(module_names)- @@disabled_modules += Array(module_names).map(&:to_sym).each do |module_name|- OpenProject::AccessControl.remove_modules_permissions(module_name)- end+ def disable_modules!(module_names)+ @@disabled_modules += Array(module_names).map(&:to_sym).each do |module_name|+ OpenProject::AccessControl.remove_modules_permissions(module_name)endendenddiff --git a/lib/open_project/text_formatting/renderer.rb b/lib/open_project/text_formatting/renderer.rbindex 626f0ee5d6b..0602a535e2d 100644--- a/lib/open_project/text_formatting/renderer.rb+++ b/lib/open_project/text_formatting/renderer.rb@@ -27,22 +27,22 @@#++module OpenProject::TextFormatting- class Renderer- class << self- def format_text(text, options = {})- return '' if text.blank?+ module Renderer+ module_function- formatter(plain: options.delete(:plain))- .new(options)- .to_html(text)- end+ def format_text(text, options = {})+ return '' if text.blank?++ formatter(plain: options.delete(:plain))+ .new(options)+ .to_html(text)+ end- def formatter(plain: false)- if plain- OpenProject::TextFormatting::Formats.plain_formatter- else- OpenProject::TextFormatting::Formats.rich_formatter- end+ def formatter(plain: false)+ if plain+ OpenProject::TextFormatting::Formats.plain_formatter+ else+ OpenProject::TextFormatting::Formats.rich_formatterendendenddiff --git a/lib/redmine/about.rb b/lib/redmine/about.rbindex 32820c7e285..60270ac5329 100644--- a/lib/redmine/about.rb+++ b/lib/redmine/about.rb@@ -27,8 +27,10 @@#++module Redmine- class About- def self.print_plugin_info+ module About+ module_function++ def print_plugin_infoplugins = Redmine::Plugin.registered_pluginsif !plugins.empty?diff --git a/lib/tasks/parallel_testing.rake b/lib/tasks/parallel_testing.rakeindex 279eb511f16..3d9cf3f1a5b 100644--- a/lib/tasks/parallel_testing.rake+++ b/lib/tasks/parallel_testing.rake@@ -45,8 +45,10 @@ def check_for_pending_migrationsendnamespace :parallel do- class ParallelParser- def self.with_args(args, allow_seed = true)+ module ParallelParser+ module_function++ def with_args(args, allow_seed = true)options = {}parseable_args = args[2..-1]if parseable_args@@ -128,7 +130,7 @@ namespace :parallel dodesc 'Run plugin unit specs in parallel'task units: [:environment] do- pattern = "--pattern 'spec/(?!features\/)'"+ pattern = "--pattern 'spec/(?!features/)'"ParallelParser.with_args(ARGV) do |options|ARGV.each { |a| task(a.to_sym) {} }@@ -139,7 +141,7 @@ namespace :parallel dodesc 'Run plugin feature specs in parallel'task features: [:environment] do- pattern = "--pattern 'spec\/features'"+ pattern = "--pattern 'spec/features'"ParallelParser.with_args(ARGV) do |options|ARGV.each { |a| task(a.to_sym) {} }@@ -160,7 +162,7 @@ namespace :parallel dodesc 'Run feature specs in parallel'task features: [:environment] do- pattern = "--pattern 'spec\/features\/'"+ pattern = "--pattern 'spec/features/'"ParallelParser.with_args(ARGV) do |options|ARGV.each { |a| task(a.to_sym) {} }@@ -171,7 +173,7 @@ namespace :parallel dodesc 'Run unit specs in parallel'task units: [:environment] do- pattern = "--pattern 'spec/(?!features\/)'"+ pattern = "--pattern 'spec/(?!features/)'"ParallelParser.with_args(ARGV) do |options|ARGV.each { |a| task(a.to_sym) {} }diff --git a/modules/auth_saml/lib/open_project/auth_saml/inspector.rb b/modules/auth_saml/lib/open_project/auth_saml/inspector.rbindex 2f76b321997..3f745dce999 100644--- a/modules/auth_saml/lib/open_project/auth_saml/inspector.rb+++ b/modules/auth_saml/lib/open_project/auth_saml/inspector.rb@@ -1,7 +1,9 @@module OpenProjectmodule AuthSaml- class Inspector- def self.inspect_response(auth_hash)+ module Inspector+ module_function++ def inspect_response(auth_hash)response = auth_hash.dig(:extra, :response_object)if responsecode = response.status_code ? "(CODE #{response.status_code})" : nildiff --git a/modules/bim/lib/api/bim/utilities/path_helper.rb b/modules/bim/lib/api/bim/utilities/path_helper.rbindex 07f6df78028..978260d651a 100644--- a/modules/bim/lib/api/bim/utilities/path_helper.rb+++ b/modules/bim/lib/api/bim/utilities/path_helper.rb@@ -33,34 +33,36 @@ module APIinclude API::Utilities::UrlHelper# rubocop:disable Naming/ClassAndModuleCamelCase- class BCF2_1Path+ module BCF2_1Path+ module_function+# rubocop:enable Naming/ClassAndModuleCamelCaseextend API::Utilities::UrlHelper# Determining the root_path on every url we want to render is# expensive. As the root_path will not change within a# request, we can cache the first response on each request.- def self.root_path+ def root_pathRequestStore.store[:cached_root_path] ||= superend- def self.root+ def root"#{root_path}api/bcf/2.1/"end- def self.project(identifier)+ def project(identifier)"#{root}projects/#{identifier}"end- def self.topics(project_identifier)+ def topics(project_identifier)"#{project(project_identifier)}/topics"end- def self.topic(project_identifier, uuid)+ def topic(project_identifier, uuid)"#{topics(project_identifier)}/#{uuid}"end- def self.viewpoint(project_identifier, topic_uuid, viewpoint_topic)+ def viewpoint(project_identifier, topic_uuid, viewpoint_topic)"#{topic(project_identifier, topic_uuid)}/viewpoints/#{viewpoint_topic}"endenddiff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rbindex e4ac3055f65..f59d1c54aa2 100644--- a/spec/controllers/application_controller_spec.rb+++ b/spec/controllers/application_controller_spec.rb@@ -41,7 +41,7 @@ describe ApplicationController, type: :controller dodescribe 'logging requesting users' dolet(:user_message) do- "OpenProject User: #{user.firstname} Crazy! Name with \#\# " ++ "OpenProject User: #{user.firstname} Crazy! Name with ## " +"Newline (#{user.login} ID: #{user.id} <#{user.mail}>)"enddiff --git a/spec/features/notifications/reminder_mail_spec.rb b/spec/features/notifications/reminder_mail_spec.rbindex b58757d0a8a..a7836c2eb8f 100644--- a/spec/features/notifications/reminder_mail_spec.rb+++ b/spec/features/notifications/reminder_mail_spec.rb@@ -67,10 +67,10 @@ describe "Reminder email sending", type: :feature, js: true do# Perform some actions the user listens toUser.execute_as other_user donote = <<~NOTE- Hey <mention class=\"mention\"- data-id=\"#{current_user.id}\"- data-type=\"user\"- data-text=\"@#{current_user.name}\">+ Hey <mention class="mention"+ data-id="#{current_user.id}"+ data-type="user"+ data-text="@#{current_user.name}">@#{current_user.name}</mention>NOTEdiff --git a/spec/features/notifications/settings/immediate_reminder_spec.rb b/spec/features/notifications/settings/immediate_reminder_spec.rbindex 157a9fd1c8e..a5efca45b59 100644--- a/spec/features/notifications/settings/immediate_reminder_spec.rb+++ b/spec/features/notifications/settings/immediate_reminder_spec.rb@@ -78,10 +78,10 @@ describe "Immediate reminder settings", type: :feature, js: true doit 'sends a mail to the mentioned user immediately' doperform_enqueued_jobs donote = <<~NOTE- Hey <mention class=\"mention\"- data-id=\"#{receiver.id}\"- data-type=\"user\"- data-text=\"@#{receiver.name}\">+ Hey <mention class="mention"+ data-id="#{receiver.id}"+ data-type="user"+ data-text="@#{receiver.name}">@#{receiver.name}</mention>NOTEdiff --git a/spec/features/wiki/wiki_unicode_spec.rb b/spec/features/wiki/wiki_unicode_spec.rbindex 417132d2fee..cf83819d852 100644--- a/spec/features/wiki/wiki_unicode_spec.rb+++ b/spec/features/wiki/wiki_unicode_spec.rb@@ -102,7 +102,7 @@ describe 'Wiki unicode title spec', type: :feature, js: true dotarget_link = all('div.wiki-content a.wiki-page')[i]expect(target_link.text).to eq(title)- expect(target_link[:href]).to match("\/wiki\/#{expected_slugs[i]}")+ expect(target_link[:href]).to match("/wiki/#{expected_slugs[i]}")target_link.clickexpect(page).to have_selector('.title-container h2', text: title)diff --git a/spec/lib/api/v3/work_packages/eager_loading/eager_loading_mock_wrapper.rb b/spec/lib/api/v3/work_packages/eager_loading/eager_loading_mock_wrapper.rbindex 876f03e21a5..4773c149328 100644--- a/spec/lib/api/v3/work_packages/eager_loading/eager_loading_mock_wrapper.rb+++ b/spec/lib/api/v3/work_packages/eager_loading/eager_loading_mock_wrapper.rb@@ -26,8 +26,10 @@# See COPYRIGHT and LICENSE files for more details.#++-class EagerLoadingMockWrapper- def self.wrap(klass, work_packages)+module EagerLoadingMockWrapper+ module_function++ def wrap(klass, work_packages)klass_module = klass.moduledelegator_class = Class.new(SimpleDelegator) dodiff --git a/spec/lib/custom_field_form_builder_spec.rb b/spec/lib/custom_field_form_builder_spec.rbindex 41dafeb7661..494b6625465 100644--- a/spec/lib/custom_field_form_builder_spec.rb+++ b/spec/lib/custom_field_form_builder_spec.rb@@ -205,8 +205,8 @@ describe CustomFieldFormBuilder doid="user#{custom_field.id}"name="user[#{custom_field.id}]"no_label="true"><option- value=\"\" label=\" \"></option>- <option value=\"#{custom_option.id}\">my_option</option></select>+ value="" label=" "></option>+ <option value="#{custom_option.id}">my_option</option></select>}).at_path('select')end@@ -220,9 +220,9 @@ describe CustomFieldFormBuilder do<select class="custom-class form--select"id="user#{custom_field.id}"name="user[#{custom_field.id}]"- no_label="true"><option value=\"\">---+ no_label="true"><option value="">---Please select ---</option>- <option value=\"#{custom_option.id}\">my_option</option></select>+ <option value="#{custom_option.id}">my_option</option></select>}).at_path('select')endend@@ -239,7 +239,7 @@ describe CustomFieldFormBuilder doid="user#{custom_field.id}"name="user[#{custom_field.id}]"no_label="true"><option- value=\"#{custom_option.id}\">my_option</option></select>+ value="#{custom_option.id}">my_option</option></select>}).at_path('select')endend@@ -274,7 +274,7 @@ describe CustomFieldFormBuilder doid="user#{custom_field.id}"name="user[#{custom_field.id}]"no_label="true">- <option value=\"\" label=\" \"></option>+ <option value="" label=" "></option><option value="#{user1.id}">#{user1.name}</option><option value="#{user2.id}">#{user2.name}</option></select>@@ -292,7 +292,7 @@ describe CustomFieldFormBuilder doid="user#{custom_field.id}"name="user[#{custom_field.id}]"no_label="true">- <option value=\"\">--- Please select ---</option>+ <option value="">--- Please select ---</option><option value="#{user1.id}">#{user1.name}</option><option value="#{user2.id}">#{user2.name}</option></select>@@ -329,7 +329,7 @@ describe CustomFieldFormBuilder doid="user#{custom_field.id}"name="user[#{custom_field.id}]"no_label="true">- <option value=\"\" label=\" \"></option>+ <option value="" label=" "></option><option value="#{version1.id}">#{version1.name}</option><option value="#{version2.id}">#{version2.name}</option></select>@@ -347,7 +347,7 @@ describe CustomFieldFormBuilder doid="user#{custom_field.id}"name="user[#{custom_field.id}]"no_label="true">- <option value=\"\">--- Please select ---</option>+ <option value="">--- Please select ---</option><option value="#{version1.id}">#{version1.name}</option><option value="#{version2.id}">#{version2.name}</option></select>diff --git a/spec/lib/open_project/text_formatting/markdown/embedded_table_macro_spec.rb b/spec/lib/open_project/text_formatting/markdown/embedded_table_macro_spec.rbindex c6d1eac7d41..687e5226098 100644--- a/spec/lib/open_project/text_formatting/markdown/embedded_table_macro_spec.rb+++ b/spec/lib/open_project/text_formatting/markdown/embedded_table_macro_spec.rb@@ -37,7 +37,7 @@ describe OpenProject::TextFormatting,let(:raw) do<<~RAW<macro class="embedded-table op-uc-placeholder"- data-query-props="{"columns[]":["id","subject","type","status","assignee","updatedAt"],"showSums":false,"timelineVisible":false,"highlightingMode":"inline","highlightedAttributes[]":["/api/v3/queries/columns/status","/api/v3/queries/columns/priority","/api/v3/queries/columns/dueDate"],"showHierarchies":true,"groupBy":"","filters":"[{\"status\":{\"operator\":\"o\",\"values\":[]}}]","sortBy":"[[\"id\",\"asc\"]]"}">+ data-query-props="{"columns[]":["id","subject","type","status","assignee","updatedAt"],"showSums":false,"timelineVisible":false,"highlightingMode":"inline","highlightedAttributes[]":["/api/v3/queries/columns/status","/api/v3/queries/columns/priority","/api/v3/queries/columns/dueDate"],"showHierarchies":true,"groupBy":"","filters":"[{"status":{"operator":"o","values":[]}}]","sortBy":"[["id","asc"]]"}"></macro>RAWenddiff --git a/spec/lib/redmine/unified_diff_spec.rb b/spec/lib/redmine/unified_diff_spec.rbindex bc365a3e379..9ad236ce5e2 100644--- a/spec/lib/redmine/unified_diff_spec.rb+++ b/spec/lib/redmine/unified_diff_spec.rb@@ -145,7 +145,7 @@ describe Redmine::UnifiedDiff do+ @truncated = falsediff_table = DiffTable.new(diff_type)diff.each do |line|- if line =~ /^(---|\+\+\+) (.*)$/+ if line =~ /^(---|+++) (.*)$/@@ -28,10 +31,17 @@diff_table = DiffTable.new(diff_type)enddiff --git a/spec/support/parallel_helper.rb b/spec/support/parallel_helper.rbindex 4a54f69b9a6..72070d68076 100644--- a/spec/support/parallel_helper.rb+++ b/spec/support/parallel_helper.rb@@ -1,9 +1,11 @@-class ParallelHelper- def self.port_for_ldap+module ParallelHelper+ module_function++ def port_for_ldapENV.fetch('TEST_ENV_NUMBER', '1').to_i + 12389end- def self.port_for_app+ def port_for_appENV.fetch('TEST_ENV_NUMBER', '1').to_i + 3000endenddiff --git a/spec/support/selenium_hub_waiter.rb b/spec/support/selenium_hub_waiter.rbindex 6f2ea12bd89..1c819cd5b6b 100644--- a/spec/support/selenium_hub_waiter.rb+++ b/spec/support/selenium_hub_waiter.rb@@ -1,7 +1,9 @@-class SeleniumHubWaiter+module SeleniumHubWaiter+ module_function+# frontend not fast enough to bind click handlers on buttons?# only happens when using the Selenium Hub- def self.wait+ def waitsleep 1 if ENV.fetch("SELENIUM_GRID_URL", "").present?endend