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
rubocop autocorrect
Ivan Kuchinb10e6d718cc4
diff --git a/app/components/admin/attachments_settings_header_component.rb b/app/components/admin/attachments_settings_header_component.rbindex f9a955648a2..88d13b0c180 100644--- a/app/components/admin/attachments_settings_header_component.rb+++ b/app/components/admin/attachments_settings_header_component.rb@@ -31,7 +31,8 @@module Adminclass AttachmentsSettingsHeaderComponent < ApplicationComponentdef initialize(title:, selected:)- raise 'selected must 1, 2 or 3' if [1, 2, 3].exclude?(selected)+ raise "selected must 1, 2 or 3" if [1, 2, 3].exclude?(selected)+@title = title@selected = selectedenddiff --git a/app/helpers/frontend_asset_helper.rb b/app/helpers/frontend_asset_helper.rbindex 9adfd5dbefd..3d1d30b9176 100644--- a/app/helpers/frontend_asset_helper.rb+++ b/app/helpers/frontend_asset_helper.rb@@ -27,14 +27,14 @@#++module FrontendAssetHelper- CLI_DEFAULT_PROXY = 'http://localhost:4200'.freeze+ CLI_DEFAULT_PROXY = "http://localhost:4200".freezedef self.assets_proxied?- ENV['OPENPROJECT_DISABLE_DEV_ASSET_PROXY'].blank? && !Rails.env.production? && cli_proxy.present?+ ENV["OPENPROJECT_DISABLE_DEV_ASSET_PROXY"].blank? && !Rails.env.production? && cli_proxy.present?enddef self.cli_proxy- ENV.fetch('OPENPROJECT_CLI_PROXY', CLI_DEFAULT_PROXY)+ ENV.fetch("OPENPROJECT_CLI_PROXY", CLI_DEFAULT_PROXY)end##diff --git a/app/models/project.rb b/app/models/project.rbindex dbb53cbdefc..1bb82198272 100644--- a/app/models/project.rb+++ b/app/models/project.rb@@ -40,7 +40,6 @@ class Project < ApplicationRecordinclude ::Scopes::Scoped-# Maximum length for project identifiersIDENTIFIER_MAX_LENGTH = 100diff --git a/app/models/setting.rb b/app/models/setting.rbindex 749ce4dfbf4..0d885dd16a1 100644--- a/app/models/setting.rb+++ b/app/models/setting.rb@@ -133,7 +133,7 @@ class Setting < ApplicationRecordprivatedef accessor_base_name(name)- name.to_s.sub(/(_writable\?)|(\?)|=\z/, '')+ name.to_s.sub(/(_writable\?)|(\?)|=\z/, "")endend@@ -337,7 +337,7 @@ class Setting < ApplicationRecordif definition.serialized? && value.is_a?(String)deserialize_hash(value)- elsif value != ''.freeze && !value.nil?+ elsif value != "".freeze && !value.nil?read_formatted_setting(value, definition.format)elsedefinition.format == :string ? value : nildiff --git a/app/models/work_package/exports/macros/attributes.rb b/app/models/work_package/exports/macros/attributes.rbindex 8b50adfa503..d8b30f79340 100644--- a/app/models/work_package/exports/macros/attributes.rb+++ b/app/models/work_package/exports/macros/attributes.rb@@ -77,16 +77,16 @@ module WorkPackage::Exportselsif model_s == "project"resolve_project_match(id || work_package.project.id, type, attribute, user)else- msg_macro_error I18n.t('export.macro.model_not_found', model: model_s)+ msg_macro_error I18n.t("export.macro.model_not_found", model: model_s)endenddef self.msg_macro_error(message)- msg_inline I18n.t('export.macro.error', message:)+ msg_inline I18n.t("export.macro.error", message:)enddef self.msg_macro_error_rich_text- msg_inline I18n.t('export.macro.rich_text_unsupported')+ msg_inline I18n.t("export.macro.rich_text_unsupported")enddef self.msg_inline(message)@@ -109,11 +109,11 @@ module WorkPackage::Exportsdef self.resolve_work_package_match(id, type, attribute, user)return resolve_label_work_package(attribute) if type == "label"- return msg_macro_error(I18n.t('export.macro.model_not_found', model: type)) unless type == "value"+ return msg_macro_error(I18n.t("export.macro.model_not_found", model: type)) unless type == "value"work_package = WorkPackage.visible(user).find_by(id:)if work_package.nil?- return msg_macro_error(I18n.t('export.macro.resource_not_found', resource: "#{WorkPackage.name} #{id}"))+ return msg_macro_error(I18n.t("export.macro.resource_not_found", resource: "#{WorkPackage.name} #{id}"))endresolve_value_work_package(work_package, attribute)diff --git a/app/services/projects/copy_service.rb b/app/services/projects/copy_service.rbindex 9983adeb566..72c3990f3a9 100644--- a/app/services/projects/copy_service.rb+++ b/app/services/projects/copy_service.rb@@ -99,8 +99,9 @@ module Projectsenddef copy_activated_custom_fields(call)- call.result.project_custom_field_ids = source.project_custom_field_ids+ call.result.project_custom_field_ids = source.project_custom_field_idsend+def contract_options{ copy_source: source, validate_model: true }enddiff --git a/app/services/users/change_password_service.rb b/app/services/users/change_password_service.rbindex b6ccf84b0a2..b2f5c41f7ab 100644--- a/app/services/users/change_password_service.rb+++ b/app/services/users/change_password_service.rb@@ -65,7 +65,7 @@ module Usersdef invalidate_tokens::Users::DropTokensService- .new(current_user: current_user)+ .new(current_user:).call!enddiff --git a/app/services/users/drop_tokens_service.rb b/app/services/users/drop_tokens_service.rbindex 098f397e9ad..56f79cb75c1 100644--- a/app/services/users/drop_tokens_service.rb+++ b/app/services/users/drop_tokens_service.rb@@ -46,11 +46,11 @@ module Usersprivatedef invalidate_recovery_tokens- Token::Recovery.where(user: user).delete_all+ Token::Recovery.where(user:).delete_allenddef invalidate_invitation_tokens- Token::Invitation.where(user: user).delete_all+ Token::Invitation.where(user:).delete_allendendenddiff --git a/db/migrate/20221115082403_add_ldap_tls_options.rb b/db/migrate/20221115082403_add_ldap_tls_options.rbindex ef5dbb5d6c2..862b5305e46 100644--- a/db/migrate/20221115082403_add_ldap_tls_options.rb+++ b/db/migrate/20221115082403_add_ldap_tls_options.rb@@ -42,7 +42,7 @@ class AddLdapTlsOptions < ActiveRecord::Migration[7.0]# Current LDAP library default is to not verify the certificateMigratingAuthSource.reset_column_information- ldap_settings = Setting.find_by(name: 'ldap_tls_options')&.value+ ldap_settings = Setting.find_by(name: "ldap_tls_options")&.valuemigrate_ldap_settings(ldap_settings)endend@@ -54,7 +54,7 @@ class AddLdapTlsOptions < ActiveRecord::Migration[7.0]return if ldap_settings.blank?parsed = Setting.deserialize_hash(ldap_settings)- verify_peer = parsed['verify_mode'] == OpenSSL::SSL::VERIFY_PEER+ verify_peer = parsed["verify_mode"] == OpenSSL::SSL::VERIFY_PEERMigratingAuthSource.update_all(verify_peer:)rescue StandardError => ediff --git a/db/migrate/20240408132459_rename_delay_to_lag.rb b/db/migrate/20240408132459_rename_delay_to_lag.rbindex 969c2eefbae..386790aefb8 100644--- a/db/migrate/20240408132459_rename_delay_to_lag.rb+++ b/db/migrate/20240408132459_rename_delay_to_lag.rb@@ -3,6 +3,6 @@ class RenameDelayToLag < ActiveRecord::Migration[7.1]rename_column :relations, :delay, :lag# TODO remove after 14.0- add_column :relations, :delay, :virtual, type: :integer, as: 'lag', stored: true+ add_column :relations, :delay, :virtual, type: :integer, as: "lag", stored: trueendenddiff --git a/db/migrate/20240410060041_remove_virtual_delay_column.rb b/db/migrate/20240410060041_remove_virtual_delay_column.rbindex 69c75e4083d..5fc36f3cd66 100644--- a/db/migrate/20240410060041_remove_virtual_delay_column.rb+++ b/db/migrate/20240410060041_remove_virtual_delay_column.rb@@ -1,5 +1,5 @@class RemoveVirtualDelayColumn < ActiveRecord::Migration[7.1]def change- remove_column :relations, :delay, :virtual, type: :integer, as: 'lag', stored: true+ remove_column :relations, :delay, :virtual, type: :integer, as: "lag", stored: trueendenddiff --git a/lib/primer/open_project/forms/dsl/project_autocompleter_input.rb b/lib/primer/open_project/forms/dsl/project_autocompleter_input.rbindex 5b58c0ba542..4c43d5fcd14 100644--- a/lib/primer/open_project/forms/dsl/project_autocompleter_input.rb+++ b/lib/primer/open_project/forms/dsl/project_autocompleter_input.rb@@ -9,7 +9,7 @@ module Primeroptions.reverse_merge!(component: "opce-project-autocompleter",defaultData: false,- filters: [{ name: 'active', operator: '=', values: ['t'] }],+ filters: [{ name: "active", operator: "=", values: ["t"] }])if options[:disabledProjects]diff --git a/lib_static/plugins/acts_as_journalized/lib/acts/journalized/journable_differ.rb b/lib_static/plugins/acts_as_journalized/lib/acts/journalized/journable_differ.rbindex 51ae9205edf..35f9c13a5f3 100644--- a/lib_static/plugins/acts_as_journalized/lib/acts/journalized/journable_differ.rb+++ b/lib_static/plugins/acts_as_journalized/lib/acts/journalized/journable_differ.rb@@ -42,7 +42,7 @@ module Acts::Journalizedget_association_changes(original, changed, *)end- def association_changes_multiple_attributes(original, changed, association, association_name, key, values)+ def association_changes_multiple_attributes(original, changed, association, association_name, key, values)list = {}values.each do |value|list.store(value, get_association_changes(original, changed, association, association_name, key, value))@@ -69,7 +69,7 @@ module Acts::Journalizeddef no_nil_to_empty_strings?(normalized_old_data, attribute, new_value)old_value = normalized_old_data[attribute]- new_value != old_value && ([new_value, old_value] - ['', nil]).present?+ new_value != old_value && ([new_value, old_value] - ["", nil]).present?enddef journaled_attributes(object)@@ -133,7 +133,7 @@ module Acts::Journalizedif selected_journals.empty?nilelse- selected_journals.sort.join(',')+ selected_journals.sort.join(",")endendenddiff --git a/lib_static/plugins/acts_as_journalized/lib/acts_as_journalized.rb b/lib_static/plugins/acts_as_journalized/lib/acts_as_journalized.rbindex 0c5862d6362..016922887d6 100644--- a/lib_static/plugins/acts_as_journalized/lib/acts_as_journalized.rb+++ b/lib_static/plugins/acts_as_journalized/lib/acts_as_journalized.rb@@ -45,14 +45,14 @@# along with this program; if not, write to the Free Software# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.-require 'journal_changes'-require 'journal_formatter'-require 'cause_of_change'+require "journal_changes"+require "journal_formatter"+require "cause_of_change"module Actsend-Dir[File.expand_path('acts/journalized/*.rb', __dir__)].sort.each { |f| require f }+Dir[File.expand_path("acts/journalized/*.rb", __dir__)].sort.each { |f| require f }module Actsmodule Journalizeddiff --git a/lib_static/plugins/acts_as_journalized/lib/cause_of_change.rb b/lib_static/plugins/acts_as_journalized/lib/cause_of_change.rbindex c7294d844ce..0202fe10dea 100644--- a/lib_static/plugins/acts_as_journalized/lib/cause_of_change.rb+++ b/lib_static/plugins/acts_as_journalized/lib/cause_of_change.rb@@ -45,8 +45,8 @@# along with this program; if not, write to the Free Software# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.-require_relative 'cause_of_change/base'-require_relative 'cause_of_change/no_cause'+require_relative "cause_of_change/base"+require_relative "cause_of_change/no_cause"module CauseOfChangeenddiff --git a/modules/calendar/spec/features/calendar_widget_spec.rb b/modules/calendar/spec/features/calendar_widget_spec.rbindex 29d9f0fedf4..da3a483d735 100644--- a/modules/calendar/spec/features/calendar_widget_spec.rb+++ b/modules/calendar/spec/features/calendar_widget_spec.rb@@ -65,15 +65,14 @@ RSpec.describe "Calendar Widget", :js, :with_cuprite, with_settings: { start_of_overview_page.expect_and_dismiss_toaster message: I18n.t("js.notice_successful_update")end- it 'shows the meeting' do- expect(page).to have_css('.fc-event', text: "Weekly", visible: :all)- page.find('.fc-event', text: "Weekly", visible: :all).click+ it "shows the meeting" do+ expect(page).to have_css(".fc-event", text: "Weekly", visible: :all)+ page.find(".fc-event", text: "Weekly", visible: :all).clickexpect(page).to have_current_path /meetings\/#{meeting.id}/endit "opens the work package full view when clicking a calendar entry" do-# Clicking the calendar entry goes to work package full screenpage.find(".fc-event-title", text: work_package.subject).clickwp_full_view.ensure_page_loadeddiff --git a/modules/meeting/app/forms/meeting/title.rb b/modules/meeting/app/forms/meeting/title.rbindex 8df8e0deb5e..801c3d84a8f 100644--- a/modules/meeting/app/forms/meeting/title.rb+++ b/modules/meeting/app/forms/meeting/title.rb@@ -47,7 +47,7 @@ class Meeting::Title < ApplicationFormscheme: :secondary,label: I18n.t(:button_cancel),tag: :a,- data: { 'turbo-stream': true },+ data: { "turbo-stream": true },href: OpenProject::StaticRouting::StaticUrlHelpers.new.cancel_edit_meeting_path(@meeting))enddiff --git a/modules/meeting/app/models/activities/meeting_activity_provider.rb b/modules/meeting/app/models/activities/meeting_activity_provider.rbindex 21a2e800fed..45f51b1f0cc 100644--- a/modules/meeting/app/models/activities/meeting_activity_provider.rb+++ b/modules/meeting/app/models/activities/meeting_activity_provider.rb@@ -27,7 +27,7 @@#++class Activities::MeetingActivityProvider < Activities::BaseActivityProvider- activity_provider_for type: 'meetings',+ activity_provider_for type: "meetings",activities: %i[meeting meeting_content],permission: :view_meetings@@ -35,7 +35,7 @@ class Activities::MeetingActivityProvider < Activities::BaseActivityProvidercase activitywhen :meeting_contentquery.join(meetings_table).on(activity_journals_table[:meeting_id].eq(meetings_table[:id]))- join_cond = journals_table[:journable_type].eq('MeetingContent')+ join_cond = journals_table[:journable_type].eq("MeetingContent")query.join(meeting_contents_table).on(journals_table[:journable_id].eq(meeting_contents_table[:id]).and(join_cond))elsesuper@@ -46,17 +46,17 @@ class Activities::MeetingActivityProvider < Activities::BaseActivityProvidercase activitywhen :meeting[- activity_journal_projection_statement(:title, 'meeting_title'),- activity_journal_projection_statement(:start_time, 'meeting_start_time'),- activity_journal_projection_statement(:duration, 'meeting_duration'),- activity_journal_projection_statement(:project_id, 'project_id')+ activity_journal_projection_statement(:title, "meeting_title"),+ activity_journal_projection_statement(:start_time, "meeting_start_time"),+ activity_journal_projection_statement(:duration, "meeting_duration"),+ activity_journal_projection_statement(:project_id, "project_id")]else[- projection_statement(meeting_contents_table, :type, 'meeting_content_type'),- projection_statement(meetings_table, :id, 'meeting_id'),- projection_statement(meetings_table, :title, 'meeting_title'),- projection_statement(meetings_table, :project_id, 'project_id')+ projection_statement(meeting_contents_table, :type, "meeting_content_type"),+ projection_statement(meetings_table, :id, "meeting_id"),+ projection_statement(meetings_table, :title, "meeting_title"),+ projection_statement(meetings_table, :project_id, "project_id")]endend@@ -86,13 +86,13 @@ class Activities::MeetingActivityProvider < Activities::BaseActivityProviderprotecteddef event_name(event)- case event['event_description']- when 'Agenda closed'- I18n.t('meeting_agenda_closed', scope: 'events')- when 'Agenda opened'- I18n.t('meeting_agenda_opened', scope: 'events')- when 'Minutes created'- I18n.t('meeting_minutes_created', scope: 'events')+ case event["event_description"]+ when "Agenda closed"+ I18n.t("meeting_agenda_closed", scope: "events")+ when "Agenda opened"+ I18n.t("meeting_agenda_opened", scope: "events")+ when "Minutes created"+ I18n.t("meeting_minutes_created", scope: "events")elsesuperend@@ -101,12 +101,12 @@ class Activities::MeetingActivityProvider < Activities::BaseActivityProviderdef event_title(event)case activitywhen :meeting- start_time = if event['meeting_start_time'].is_a?(String)- DateTime.parse(event['meeting_start_time'])+ start_time = if event["meeting_start_time"].is_a?(String)+ DateTime.parse(event["meeting_start_time"])else- event['meeting_start_time']+ event["meeting_start_time"]end- end_time = start_time + event['meeting_duration'].to_f.hours+ end_time = start_time + event["meeting_duration"].to_f.hoursfstart_with = format_date start_timefstart_without = format_time start_time, false@@ -121,9 +121,9 @@ class Activities::MeetingActivityProvider < Activities::BaseActivityProviderdef event_type(event)case activitywhen :meeting- 'meeting'+ "meeting"else- event['meeting_content_type'].include?('Agenda') ? 'meeting-agenda' : 'meeting-minutes'+ event["meeting_content_type"].include?("Agenda") ? "meeting-agenda" : "meeting-minutes"endend@@ -164,6 +164,6 @@ class Activities::MeetingActivityProvider < Activities::BaseActivityProviderenddef activity_id(event)- activity == :meeting ? event['journable_id'] : event['meeting_id']+ activity == :meeting ? event["journable_id"] : event["meeting_id"]endenddiff --git a/modules/meeting/spec/services/meetings/copy_service_integration_spec.rb b/modules/meeting/spec/services/meetings/copy_service_integration_spec.rbindex 3b6a3addbad..c103397bc3e 100644--- a/modules/meeting/spec/services/meetings/copy_service_integration_spec.rb+++ b/modules/meeting/spec/services/meetings/copy_service_integration_spec.rb@@ -48,7 +48,7 @@ RSpec.describe Meetings::CopyService, "integration", type: :model doexpect(copy.start_time).to eq(meeting.start_time + 1.week)end- context 'when the meeting is closed' do+ context "when the meeting is closed" doit "reopens the meeting" domeeting.update! state: "closed"expect(service_result).to be_successdiff --git a/modules/reporting/lib/widget/cost_types.rb b/modules/reporting/lib/widget/cost_types.rbindex 67e63d3c776..9ac7b4aac47 100644--- a/modules/reporting/lib/widget/cost_types.rb+++ b/modules/reporting/lib/widget/cost_types.rb@@ -31,7 +31,7 @@ class Widget::CostTypes < Widget::Base@cost_types = options.delete(:cost_types)@selected_type_id = options.delete(:selected_type_id)- super(options, &)+ superenddef renderdiff --git a/modules/reporting/lib/widget/reporting_widget.rb b/modules/reporting/lib/widget/reporting_widget.rbindex e413e5ffe08..3e198fac1a7 100644--- a/modules/reporting/lib/widget/reporting_widget.rb+++ b/modules/reporting/lib/widget/reporting_widget.rb@@ -40,7 +40,7 @@ class Widget::ReportingWidget < ActionView::Baseattr_accessor :output_buffer, :controller, :config, :_content_for, :_routes, :subjectdef self.new(subject)- super(subject).tap do |o|+ super.tap do |o|o.subject = subjectendenddiff --git a/modules/storages/spec/features/delete_project_storage_and_file_links_spec.rb b/modules/storages/spec/features/delete_project_storage_and_file_links_spec.rbindex ff0e9b2af7f..21a69db1631 100644--- a/modules/storages/spec/features/delete_project_storage_and_file_links_spec.rb+++ b/modules/storages/spec/features/delete_project_storage_and_file_links_spec.rb@@ -33,7 +33,7 @@ require_module_spec_helper# Test if the deletion of a ProjectStorage actually deletes related FileLink# objects.-RSpec.describe "Delete ProjectStorage with FileLinks", :js, :with_cuprite, :webmock do+RSpec.describe "Delete ProjectStorage with FileLinks", :js, :webmock, :with_cuprite dolet(:user) { create(:user) }let(:role) { create(:project_role, permissions: [:manage_files_in_project]) }let(:project) do@@ -69,7 +69,7 @@ RSpec.describe "Delete ProjectStorage with FileLinks", :js, :with_cuprite, :webmvisit external_file_storages_project_settings_project_storages_path(project)# The list of enabled file storages should now contain Storage 1- expect(page).to have_selector('h1', text: 'Files')+ expect(page).to have_css("h1", text: "Files")expect(page).to have_text("Storage 1")# Press Delete icon to remove the storage from the projectdiff --git a/modules/storages/spec/features/hide_attachments_spec.rb b/modules/storages/spec/features/hide_attachments_spec.rbindex 1f1ac0b4d30..9a96d519397 100644--- a/modules/storages/spec/features/hide_attachments_spec.rb+++ b/modules/storages/spec/features/hide_attachments_spec.rb@@ -74,7 +74,7 @@ RSpec.describe "Hide attachments", :js, :with_cuprite docontext "if Setting.show_work_package_attachments is false", with_settings: { show_work_package_attachments: false } dolet(:project) { create(:project) }- it 'renders the toggle as off for project with not set deactivate_work_package_attachments' do+ it "renders the toggle as off for project with not set deactivate_work_package_attachments" doexpect(project.deactivate_work_package_attachments).to be_nillogin_as current_user@@ -89,7 +89,7 @@ RSpec.describe "Hide attachments", :js, :with_cuprite docontext "if Setting.show_work_package_attachments is true", with_settings: { show_work_package_attachments: true } dolet(:project) { create(:project) }- it 'renders the toggle as on for project with not set deactivate_work_package_attachments' do+ it "renders the toggle as on for project with not set deactivate_work_package_attachments" doexpect(project.deactivate_work_package_attachments).to be_nillogin_as current_userdiff --git a/modules/storages/spec/features/manage_project_storage_spec.rb b/modules/storages/spec/features/manage_project_storage_spec.rbindex 758055dd9f0..df11ab2e070 100644--- a/modules/storages/spec/features/manage_project_storage_spec.rb+++ b/modules/storages/spec/features/manage_project_storage_spec.rb@@ -38,10 +38,7 @@ require_module_spec_helper# We decrease the notification polling interval because some portions of the JS code rely on something triggering# the Angular change detection. This is usually done by the notification polling, but we don't want to waitRSpec.describe("Activation of storages in projects",- :js,- :with_cuprite,- :webmock,- with_settings: { notifications_polling_interval: 1_000 }) do+ :js, :webmock, :with_cuprite, with_settings: { notifications_polling_interval: 1_000 }) dolet(:user) { create(:user) }# The first page is the Project -> Settings -> General page, so we need# to provide the user with the edit_project permission in the role.@@ -112,7 +109,7 @@ RSpec.describe("Activation of storages in projects",expect(page).to have_title("Files")expect(page).to have_current_path external_file_storages_project_settings_project_storages_path(project)expect(page).to have_text(I18n.t("storages.no_results"))- page.first(:link, 'New storage').click+ page.first(:link, "New storage").click# Can cancel the creation of a new file storageexpect(page).to have_current_path new_project_settings_project_storage_path(project_id: project)@@ -121,7 +118,7 @@ RSpec.describe("Activation of storages in projects",expect(page).to have_current_path external_file_storages_project_settings_project_storages_path(project)# Enable one file storage together with a project folder mode- page.first(:link, 'New storage').click+ page.first(:link, "New storage").clickexpect(page).to have_current_path new_project_settings_project_storage_path(project_id: project)expect(page).to have_text("Add a file storage")expect(page).to have_select("storages_project_storage_storage_id",@@ -149,14 +146,14 @@ RSpec.describe("Activation of storages in projects",page.click_button("Add")# The list of enabled file storages should now contain Storage 1- expect(page).to have_selector('h1', text: 'Files')+ expect(page).to have_css("h1", text: "Files")expect(page).to have_text(storage.name)# Press Edit icon to change the project folder mode to inactivepage.find(".icon.icon-edit").clickexpect(page).to have_current_path edit_project_settings_project_storage_path(project_id: project,id: Storages::ProjectStorage.last,- storages_project_storage: {project_folder_mode: "manual"})+ storages_project_storage: { project_folder_mode: "manual" })expect(page).to have_text("Edit the file storage to this project")expect(page).to have_no_select("storages_project_storage_storage_id")expect(page).to have_text(storage.name)@@ -169,14 +166,14 @@ RSpec.describe("Activation of storages in projects",page.click_button("Save")# The list of enabled file storages should still contain Storage 1- expect(page).to have_selector('h1', text: 'Files')+ expect(page).to have_css("h1", text: "Files")expect(page).to have_text(storage.name)# Click Edit icon again but cancel the editpage.find(".icon.icon-edit").clickexpect(page).to have_current_path edit_project_settings_project_storage_path(project_id: project,id: Storages::ProjectStorage.last,- storages_project_storage: {project_folder_mode: "inactive"})+ storages_project_storage: { project_folder_mode: "inactive" })expect(page).to have_text("Edit the file storage to this project")page.click_link("Cancel")expect(page).to have_current_path external_file_storages_project_settings_project_storages_path(project)@@ -237,7 +234,7 @@ RSpec.describe("Activation of storages in projects",it "excludes storages that are not configured correctly" dovisit external_file_storages_project_settings_project_storages_path(project)- page.first(:link, 'New storage').click+ page.first(:link, "New storage").clickaggregate_failures "select field options" doexpect(page).to have_select("storages_project_storage_storage_id",diff --git a/modules/storages/spec/features/storages/project_settings/oauth_access_grant_spec.rb b/modules/storages/spec/features/storages/project_settings/oauth_access_grant_spec.rbindex a1af0089e16..55f6c918952 100644--- a/modules/storages/spec/features/storages/project_settings/oauth_access_grant_spec.rb+++ b/modules/storages/spec/features/storages/project_settings/oauth_access_grant_spec.rb@@ -75,7 +75,7 @@ RSpec.describe "OAuth Access Grant Nudge upon adding a storage to a project",expect(page).to have_checked_field("New folder with automatically managed permissions")click_on("Add")- expect(page).to have_selector('h1', text: 'Files')+ expect(page).to have_css("h1", text: "Files")expect(page).to have_text(storage.name)within_test_selector("oauth-access-grant-nudge-modal") dodiff --git a/spec/components/members/role_form_component_spec.rb b/spec/components/members/role_form_component_spec.rbindex b2df3d14abd..bd2b550d566 100644--- a/spec/components/members/role_form_component_spec.rb+++ b/spec/components/members/role_form_component_spec.rb@@ -79,7 +79,7 @@ RSpec.describe Members::RoleFormComponent, type: :component doexpect(form).to have_css "input[name='member[user_ids][]']", visible: :hidden # rubocop:disable Capybara/SpecificMatcher- expect(form.first("input[name='member[user_ids][]']", visible: :hidden).value).to eq '42'+ expect(form.first("input[name='member[user_ids][]']", visible: :hidden).value).to eq "42"endendenddiff --git a/spec/controllers/concerns/authorization_spec.rb b/spec/controllers/concerns/authorization_spec.rbindex ac9dbd42f89..63c451dcd6d 100644--- a/spec/controllers/concerns/authorization_spec.rb+++ b/spec/controllers/concerns/authorization_spec.rb@@ -28,7 +28,7 @@require "spec_helper"-RSpec.describe ApplicationController, "enforcement of authorization" do # rubocop:disable RSpec/FilePath, RSpec/SpecFilePathFormat+RSpec.describe ApplicationController, "enforcement of authorization" do # rubocop:disable RSpec/RSpec/SpecFilePathFormatshared_let(:user) { create(:user) }controller_setup = Module.new dodiff --git a/spec/features/admin/custom_fields/link_custom_field_spec.rb b/spec/features/admin/custom_fields/link_custom_field_spec.rbindex c5b06295946..69377f47391 100644--- a/spec/features/admin/custom_fields/link_custom_field_spec.rb+++ b/spec/features/admin/custom_fields/link_custom_field_spec.rb@@ -53,7 +53,7 @@ RSpec.describe "Link custom fields edit", :js, :with_cuprite do# Expect field to be createdcf = CustomField.lastexpect(cf.name).to eq("My Link CF")- expect(cf.field_format).to eq 'link'+ expect(cf.field_format).to eq "link"# Edit againfind("a", text: "My Link CF").clickdiff --git a/spec/features/admin/project_custom_fields/list_spec.rb b/spec/features/admin/project_custom_fields/list_spec.rbindex 2c07ed5e272..612cd42a673 100644--- a/spec/features/admin/project_custom_fields/list_spec.rb+++ b/spec/features/admin/project_custom_fields/list_spec.rb@@ -26,29 +26,29 @@# See COPYRIGHT and LICENSE files for more details.#++-require 'spec_helper'-require_relative 'shared_context'+require "spec_helper"+require_relative "shared_context"-RSpec.describe 'List project custom fields', :js do- include_context 'with seeded project custom fields'+RSpec.describe "List project custom fields", :js do+ include_context "with seeded project custom fields"- context 'with unsufficient permissions' do- it 'is not accessible' do+ context "with unsufficient permissions" do+ it "is not accessible" dologin_as(non_admin)visit admin_settings_project_custom_fields_path- expect(page).to have_text('You are not authorized to access this page.')+ expect(page).to have_text("You are not authorized to access this page.")endend- context 'with sufficient permissions' do+ context "with sufficient permissions" dobefore dologin_as(admin)visit admin_settings_project_custom_fields_pathend- it 'shows all sections in the correct order and allows reordering via menu or drag and drop' do- containers = page.all('.op-project-custom-field-section-container')+ it "shows all sections in the correct order and allows reordering via menu or drag and drop" do+ containers = page.all(".op-project-custom-field-section-container")expect(containers[0].text).to include(section_for_input_fields.name)expect(containers[1].text).to include(section_for_select_fields.name)@@ -58,7 +58,7 @@ RSpec.describe 'List project custom fields', :js dovisit admin_settings_project_custom_fields_path- containers = page.all('.op-project-custom-field-section-container')+ containers = page.all(".op-project-custom-field-section-container")expect(containers[0].text).to include(section_for_input_fields.name)expect(containers[1].text).to include(section_for_multi_select_fields.name)@@ -67,9 +67,9 @@ RSpec.describe 'List project custom fields', :js do# TODO: Add drag and drop testend- it 'allows to delete a section only if no project custom fields are assigned to it' do+ it "allows to delete a section only if no project custom fields are assigned to it" dowithin_project_custom_field_section_menu(section_for_multi_select_fields) do- expect(page).to have_css("button[aria-disabled='true']", text: 'Delete')+ expect(page).to have_css("button[aria-disabled='true']", text: "Delete")endmulti_list_project_custom_field.destroy@@ -79,11 +79,11 @@ RSpec.describe 'List project custom fields', :js dovisit admin_settings_project_custom_fields_pathwithin_project_custom_field_section_menu(section_for_multi_select_fields) do- expect(page).to have_no_css("button[aria-disabled='true']", text: 'Delete')- expect(page).to have_button('Delete')+ expect(page).to have_no_css("button[aria-disabled='true']", text: "Delete")+ expect(page).to have_button("Delete")accept_confirm do- click_on('Delete')+ click_on("Delete")endend@@ -91,42 +91,42 @@ RSpec.describe 'List project custom fields', :js do.to have_no_css("[data-test-selector='project-custom-field-section-container-#{section_for_multi_select_fields.id}']")end- it 'allows to edit a section' do+ it "allows to edit a section" dowithin_project_custom_field_section_menu(section_for_input_fields) do- click_on('Edit title')+ click_on("Edit title")end- fill_in('project_custom_field_section_name', with: 'Updated section name')+ fill_in("project_custom_field_section_name", with: "Updated section name")- click_on('Save')+ click_on("Save")expect(page).to have_no_text(section_for_input_fields.name)- expect(page).to have_text('Updated section name')+ expect(page).to have_text("Updated section name")end- it 'allows to create a new section' do- within '#settings-project-custom-fields-header-component' do- click_on('dialog-show-project-custom-field-section-dialog')+ it "allows to create a new section" do+ within "#settings-project-custom-fields-header-component" do+ click_on("dialog-show-project-custom-field-section-dialog")end- fill_in('project_custom_field_section_name', with: 'New section name')+ fill_in("project_custom_field_section_name", with: "New section name")- click_on('Save')+ click_on("Save")- expect(page).to have_text('New section name')+ expect(page).to have_text("New section name")- containers = page.all('.op-project-custom-field-section-container')+ containers = page.all(".op-project-custom-field-section-container")- expect(containers[0].text).to include('New section name')+ expect(containers[0].text).to include("New section name")expect(containers[1].text).to include(section_for_input_fields.name)expect(containers[2].text).to include(section_for_select_fields.name)expect(containers[3].text).to include(section_for_multi_select_fields.name)end- describe 'managing project custom fields' do- it 'shows all custom fields in the correct order within their section and allows reordering via menu or drag and drop' do+ describe "managing project custom fields" do+ it "shows all custom fields in the correct order within their section and allows reordering via menu or drag and drop" dowithin_project_custom_field_section_container(section_for_input_fields) do- containers = page.all('.op-project-custom-field-container')+ containers = page.all(".op-project-custom-field-container")expect(containers[0].text).to include(boolean_project_custom_field.name)expect(containers[1].text).to include(string_project_custom_field.name)@@ -137,7 +137,7 @@ RSpec.describe 'List project custom fields', :js doendwithin_project_custom_field_section_container(section_for_select_fields) do- containers = page.all('.op-project-custom-field-container')+ containers = page.all(".op-project-custom-field-container")expect(containers[0].text).to include(list_project_custom_field.name)expect(containers[1].text).to include(version_project_custom_field.name)@@ -145,7 +145,7 @@ RSpec.describe 'List project custom fields', :js doendwithin_project_custom_field_section_container(section_for_multi_select_fields) do- containers = page.all('.op-project-custom-field-container')+ containers = page.all(".op-project-custom-field-container")expect(containers[0].text).to include(multi_list_project_custom_field.name)expect(containers[1].text).to include(multi_version_project_custom_field.name)@@ -157,7 +157,7 @@ RSpec.describe 'List project custom fields', :js dovisit admin_settings_project_custom_fields_pathwithin_project_custom_field_section_container(section_for_multi_select_fields) do- containers = page.all('.op-project-custom-field-container')+ containers = page.all(".op-project-custom-field-container")expect(containers[0].text).to include(multi_list_project_custom_field.name)expect(containers[1].text).to include(multi_user_project_custom_field.name)@@ -167,9 +167,9 @@ RSpec.describe 'List project custom fields', :js do# TODO: Add drag and drop testend- it 'shows the number of projects using a custom field' do+ it "shows the number of projects using a custom field" dowithin_project_custom_field_container(boolean_project_custom_field) do- expect(page).to have_text('0 Projects')+ expect(page).to have_text("0 Projects")endproject = create(:project)@@ -178,29 +178,29 @@ RSpec.describe 'List project custom fields', :js dovisit admin_settings_project_custom_fields_pathwithin_project_custom_field_container(boolean_project_custom_field) do- expect(page).to have_text('1 Project')+ expect(page).to have_text("1 Project")endend- it 'allows to delete a custom field' do+ it "allows to delete a custom field" dowithin_project_custom_field_menu(boolean_project_custom_field) doaccept_confirm do- click_on('Delete')+ click_on("Delete")endendexpect(page).to have_no_css("[data-test-selector='project-custom-field-container-#{boolean_project_custom_field.id}']")end- it 'redirects to the custom field edit page via menu item' do+ it "redirects to the custom field edit page via menu item" dowithin_project_custom_field_menu(boolean_project_custom_field) do- click_on('Edit')+ click_on("Edit")endexpect(page).to have_current_path(edit_admin_settings_project_custom_field_path(boolean_project_custom_field))end- it 'redirects to the custom field edit page via click on the name of the custom field' do+ it "redirects to the custom field edit page via click on the name of the custom field" dowithin_project_custom_field_container(boolean_project_custom_field) doclick_on(boolean_project_custom_field.name)end@@ -208,13 +208,13 @@ RSpec.describe 'List project custom fields', :js doexpect(page).to have_current_path(edit_admin_settings_project_custom_field_path(boolean_project_custom_field))end- it 'redirects to the custom field new page via header menu button' do+ it "redirects to the custom field new page via header menu button" dopage.find("[data-test-selector='new-project-custom-field-button']").click- expect(page).to have_current_path(new_admin_settings_project_custom_field_path(type: 'ProjectCustomField'))+ expect(page).to have_current_path(new_admin_settings_project_custom_field_path(type: "ProjectCustomField"))end- it 'redirects to the custom field new page via button in empty sections' do+ it "redirects to the custom field new page via button in empty sections" dowithin_project_custom_field_section_container(section_for_multi_select_fields) doexpect(page).to have_no_css("[data-test-selector='new-project-custom-field-button']")end@@ -230,7 +230,7 @@ RSpec.describe 'List project custom fields', :js doendexpect(page).to have_current_path(new_admin_settings_project_custom_field_path(- type: 'ProjectCustomField',+ type: "ProjectCustomField",custom_field_section_id: section_for_multi_select_fields.id))end@@ -246,7 +246,7 @@ RSpec.describe 'List project custom fields', :js dodef within_project_custom_field_section_menu(section, &block)within_project_custom_field_section_container(section) dopage.find("[data-test-selector='project-custom-field-section-action-menu']").click- within('anchored-position', &block)+ within("anchored-position", &block)endend@@ -264,7 +264,7 @@ RSpec.describe 'List project custom fields', :js dodef within_project_custom_field_menu(section, &block)within_project_custom_field_container(section) dopage.find("[data-test-selector='project-custom-field-action-menu']").click- within('anchored-position', &block)+ within("anchored-position", &block)endenddiff --git a/spec/features/projects/favorite_spec.rb b/spec/features/projects/favorite_spec.rbindex bc581a19456..d3c47dd7f64 100644--- a/spec/features/projects/favorite_spec.rb+++ b/spec/features/projects/favorite_spec.rb@@ -44,6 +44,7 @@ RSpec.describe "Favorite projects", :js dolet(:my_page) doPages::My::Page.newend+context "as a user" dobefore dologin_as userdiff --git a/spec/features/projects/project_custom_fields/overview_page/dialog/permission_spec.rb b/spec/features/projects/project_custom_fields/overview_page/dialog/permission_spec.rbindex aec9e99269a..b8a2d54f196 100644--- a/spec/features/projects/project_custom_fields/overview_page/dialog/permission_spec.rb+++ b/spec/features/projects/project_custom_fields/overview_page/dialog/permission_spec.rb@@ -26,15 +26,15 @@# See COPYRIGHT and LICENSE files for more details.#++-require 'spec_helper'-require_relative '../shared_context'+require "spec_helper"+require_relative "../shared_context"-RSpec.describe 'Edit project custom fields on project overview page', :js do- include_context 'with seeded projects, members and project custom fields'+RSpec.describe "Edit project custom fields on project overview page", :js do+ include_context "with seeded projects, members and project custom fields"let(:overview_page) { Pages::Projects::Show.new(project) }- describe 'with insufficient permissions' do+ describe "with insufficient permissions" do# turboframe sidebar request is covered by a controller spec checking for 403# async dialog content request is be covered by a controller spec checking for 403# via spec/permissions/manage_project_custom_values_spec.rb@@ -43,20 +43,20 @@ RSpec.describe 'Edit project custom fields on project overview page', :js dooverview_page.visit_pageend- it 'does not show the edit buttons' do+ it "does not show the edit buttons" dooverview_page.within_async_loaded_sidebar doexpect(page).to have_no_css("[data-test-selector='project-custom-field-section-edit-button']")endendend- describe 'with sufficient permissions' do+ describe "with sufficient permissions" dobefore dologin_as member_with_project_edit_permissionsoverview_page.visit_pageend- it 'shows the edit buttons' do+ it "shows the edit buttons" dooverview_page.within_async_loaded_sidebar doexpect(page).to have_css("[data-test-selector='project-custom-field-section-edit-button']", count: 3)enddiff --git a/spec/features/projects/project_custom_fields/settings/mapping_spec.rb b/spec/features/projects/project_custom_fields/settings/mapping_spec.rbindex d30b14b7f69..940c4c02bb8 100644--- a/spec/features/projects/project_custom_fields/settings/mapping_spec.rb+++ b/spec/features/projects/project_custom_fields/settings/mapping_spec.rb@@ -26,16 +26,16 @@# See COPYRIGHT and LICENSE files for more details.#++-require 'spec_helper'+require "spec_helper"-RSpec.describe 'Projects custom fields mapping via project settings', :js, :with_cuprite do- let(:project) { create(:project, name: 'Foo project', identifier: 'foo-project') }- let(:other_project) { create(:project, name: 'Bar project', identifier: 'bar-project') }+RSpec.describe "Projects custom fields mapping via project settings", :js, :with_cuprite do+ let(:project) { create(:project, name: "Foo project", identifier: "foo-project") }+ let(:other_project) { create(:project, name: "Bar project", identifier: "bar-project") }let!(:user_with_sufficient_permissions) docreate(:user,- firstname: 'Project',- lastname: 'Admin',+ firstname: "Project",+ lastname: "Admin",member_with_permissions: {project => %w[view_work_packages@@ -52,8 +52,8 @@ RSpec.describe 'Projects custom fields mapping via project settings', :js, :withlet!(:member_in_project) docreate(:user,- firstname: 'Member 1',- lastname: 'In Project',+ firstname: "Member 1",+ lastname: "In Project",member_with_permissions: { project => %w[edit_projectview_work_packages@@ -62,69 +62,69 @@ RSpec.describe 'Projects custom fields mapping via project settings', :js, :withlet!(:another_member_in_project) docreate(:user,- firstname: 'Member 2',- lastname: 'In Project',+ firstname: "Member 2",+ lastname: "In Project",member_with_permissions: { project => %w[view_work_packages] })end- let!(:section_for_input_fields) { create(:project_custom_field_section, name: 'Input fields') }- let!(:section_for_select_fields) { create(:project_custom_field_section, name: 'Select fields') }- let!(:section_for_multi_select_fields) { create(:project_custom_field_section, name: 'Multi select fields') }+ let!(:section_for_input_fields) { create(:project_custom_field_section, name: "Input fields") }+ let!(:section_for_select_fields) { create(:project_custom_field_section, name: "Select fields") }+ let!(:section_for_multi_select_fields) { create(:project_custom_field_section, name: "Multi select fields") }let!(:boolean_project_custom_field) do- create(:boolean_project_custom_field, name: 'Boolean field',+ create(:boolean_project_custom_field, name: "Boolean field",project_custom_field_section: section_for_input_fields)endlet!(:string_project_custom_field) do- create(:string_project_custom_field, name: 'String field',+ create(:string_project_custom_field, name: "String field",project_custom_field_section: section_for_input_fields)endlet!(:list_project_custom_field) do- create(:list_project_custom_field, name: 'List field',+ create(:list_project_custom_field, name: "List field",project_custom_field_section: section_for_select_fields,- possible_values: ['Option 1', 'Option 2', 'Option 3'])+ possible_values: ["Option 1", "Option 2", "Option 3"])endlet!(:multi_list_project_custom_field) do- create(:list_project_custom_field, name: 'Multi list field',+ create(:list_project_custom_field, name: "Multi list field",project_custom_field_section: section_for_multi_select_fields,- possible_values: ['Option 1', 'Option 2', 'Option 3'],+ possible_values: ["Option 1", "Option 2", "Option 3"],multi_value: true)end- describe 'with insufficient permissions' do+ describe "with insufficient permissions" dobefore dologin_as member_in_project # can edit project but is not allowed to select project custom fieldsend- it 'does not show the menu entry in the project settings menu' do+ it "does not show the menu entry in the project settings menu" dovisit project_settings_general_path(project)- within '#menu-sidebar' do+ within "#menu-sidebar" doexpect(page).to have_no_css("li[data-name='settings_project_custom_fields']")endend- it 'does not show the project custom fields page' do+ it "does not show the project custom fields page" dovisit project_settings_project_custom_fields_path(project)- expect(page).to have_content('You are not authorized to access this page.')+ expect(page).to have_content("You are not authorized to access this page.")endend- describe 'with sufficient permissions' do+ describe "with sufficient permissions" dobefore dologin_as user_with_sufficient_permissionsend- it 'does show the menu entry in the project settings menu' do+ it "does show the menu entry in the project settings menu" dovisit project_settings_general_path(project)- within '#menu-sidebar' do+ within "#menu-sidebar" doexpect(page).to have_css("li[data-name='settings_project_custom_fields']")endend@@ -151,17 +151,17 @@ RSpec.describe 'Projects custom fields mapping via project settings', :js, :withexpect(page).to have_content("Multi list field")end- it 'shows all available project custom fields with their correct mapping state' do+ it "shows all available project custom fields with their correct mapping state" dovisit project_settings_project_custom_fields_path(project)within_custom_field_section_container(section_for_input_fields) dowithin_custom_field_container(boolean_project_custom_field) do- expect(page).to have_content('Boolean field')+ expect(page).to have_content("Boolean field")expect_type("Bool")expect_unchecked_stateendwithin_custom_field_container(string_project_custom_field) do- expect(page).to have_content('String field')+ expect(page).to have_content("String field")expect_type("String")expect_unchecked_stateend@@ -169,7 +169,7 @@ RSpec.describe 'Projects custom fields mapping via project settings', :js, :withwithin_custom_field_section_container(section_for_select_fields) dowithin_custom_field_container(list_project_custom_field) do- expect(page).to have_content('List field')+ expect(page).to have_content("List field")expect_type("List")expect_unchecked_stateend@@ -177,14 +177,14 @@ RSpec.describe 'Projects custom fields mapping via project settings', :js, :withwithin_custom_field_section_container(section_for_multi_select_fields) dowithin_custom_field_container(multi_list_project_custom_field) do- expect(page).to have_content('Multi list field')+ expect(page).to have_content("Multi list field")expect_type("List")expect_unchecked_stateendendend- it 'toggles the mapping state of a project custom field for a specific project when clicked' do+ it "toggles the mapping state of a project custom field for a specific project when clicked" dovisit project_settings_project_custom_fields_path(project)within_custom_field_section_container(section_for_input_fields) do@@ -214,7 +214,7 @@ RSpec.describe 'Projects custom fields mapping via project settings', :js, :withendend- it 'enables all mapping states of a section for a specific project when bulk action button clicked' do+ it "enables all mapping states of a section for a specific project when bulk action button clicked" dovisit project_settings_project_custom_fields_path(project)within_custom_field_section_container(section_for_input_fields) do@@ -241,7 +241,7 @@ RSpec.describe 'Projects custom fields mapping via project settings', :js, :withendend- it 'disables all mapping states of a section for a specific project when bulk action button clicked' do+ it "disables all mapping states of a section for a specific project when bulk action button clicked" dovisit project_settings_project_custom_fields_path(project)within_custom_field_section_container(section_for_input_fields) do@@ -279,59 +279,59 @@ RSpec.describe 'Projects custom fields mapping via project settings', :js, :withendend- it 'filters the project custom fields by name with given user input' do+ it "filters the project custom fields by name with given user input" dovisit project_settings_project_custom_fields_path(project)- fill_in 'project-custom-fields-mapping-filter', with: 'Boolean'+ fill_in "project-custom-fields-mapping-filter", with: "Boolean"within_custom_field_section_container(section_for_input_fields) do- expect(page).to have_content('Boolean field')- expect(page).to have_no_content('String field')+ expect(page).to have_content("Boolean field")+ expect(page).to have_no_content("String field")endwithin_custom_field_section_container(section_for_select_fields) do- expect(page).to have_no_content('List field')+ expect(page).to have_no_content("List field")endwithin_custom_field_section_container(section_for_multi_select_fields) do- expect(page).to have_no_content('Multi list field')+ expect(page).to have_no_content("Multi list field")endend- it 'shows the project custom field sections in the correct order' do+ it "shows the project custom field sections in the correct order" dovisit project_settings_project_custom_fields_path(project)- sections = page.all('.op-project-custom-field-section')+ sections = page.all(".op-project-custom-field-section")expect(sections.size).to eq(3)- expect(sections[0].text).to include('Input fields')- expect(sections[1].text).to include('Select fields')- expect(sections[2].text).to include('Multi select fields')+ expect(sections[0].text).to include("Input fields")+ expect(sections[1].text).to include("Select fields")+ expect(sections[2].text).to include("Multi select fields")section_for_input_fields.move_to_bottomvisit project_settings_project_custom_fields_path(project)- sections = page.all('.op-project-custom-field-section')+ sections = page.all(".op-project-custom-field-section")expect(sections.size).to eq(3)- expect(sections[0].text).to include('Select fields')- expect(sections[1].text).to include('Multi select fields')- expect(sections[2].text).to include('Input fields')+ expect(sections[0].text).to include("Select fields")+ expect(sections[1].text).to include("Multi select fields")+ expect(sections[2].text).to include("Input fields")end- it 'shows the project custom fields in the correct order within the sections' do+ it "shows the project custom fields in the correct order within the sections" dovisit project_settings_project_custom_fields_path(project)within_custom_field_section_container(section_for_input_fields) do- custom_fields = page.all('.op-project-custom-field')+ custom_fields = page.all(".op-project-custom-field")expect(custom_fields.size).to eq(2)- expect(custom_fields[0].text).to include('Boolean field')- expect(custom_fields[1].text).to include('String field')+ expect(custom_fields[0].text).to include("Boolean field")+ expect(custom_fields[1].text).to include("String field")endboolean_project_custom_field.move_to_bottom@@ -339,21 +339,21 @@ RSpec.describe 'Projects custom fields mapping via project settings', :js, :withvisit project_settings_project_custom_fields_path(project)within_custom_field_section_container(section_for_input_fields) do- custom_fields = page.all('.op-project-custom-field')+ custom_fields = page.all(".op-project-custom-field")expect(custom_fields.size).to eq(2)- expect(custom_fields[0].text).to include('String field')- expect(custom_fields[1].text).to include('Boolean field')+ expect(custom_fields[0].text).to include("String field")+ expect(custom_fields[1].text).to include("Boolean field")endend- context 'with visibility of project custom fields' do- let!(:section_with_invisible_fields) { create(:project_custom_field_section, name: 'Section with invisible fields') }+ context "with visibility of project custom fields" do+ let!(:section_with_invisible_fields) { create(:project_custom_field_section, name: "Section with invisible fields") }let!(:visible_project_custom_field) docreate(:project_custom_field,- name: 'Normal field',+ name: "Normal field",visible: true,projects: [project],project_custom_field_section: section_with_invisible_fields)@@ -361,13 +361,13 @@ RSpec.describe 'Projects custom fields mapping via project settings', :js, :withlet!(:invisible_project_custom_field) docreate(:project_custom_field,- name: 'Admin only field',+ name: "Admin only field",visible: false,projects: [project],project_custom_field_section: section_with_invisible_fields)end- context 'with admin permissions' do+ context "with admin permissions" dolet!(:admin) docreate(:admin)end@@ -377,14 +377,14 @@ RSpec.describe 'Projects custom fields mapping via project settings', :js, :withvisit project_settings_project_custom_fields_path(project)end- it 'shows the invisible project custom fields' do+ it "shows the invisible project custom fields" dowithin_custom_field_section_container(section_with_invisible_fields) do- expect(page).to have_content('Normal field')- expect(page).to have_content('Admin only field')+ expect(page).to have_content("Normal field")+ expect(page).to have_content("Admin only field")endend- it 'includeds the invisible project custom fields in the bulk actions' do+ it "includeds the invisible project custom fields in the bulk actions" dowithin_custom_field_section_container(section_with_invisible_fields) dopage.find("[data-test-selector='disable-all-project-custom-field-mappings-#{section_with_invisible_fields.id}']")@@ -411,20 +411,20 @@ RSpec.describe 'Projects custom fields mapping via project settings', :js, :withendend- context 'with non-admin permissions' do+ context "with non-admin permissions" dobefore dologin_as user_with_sufficient_permissionsvisit project_settings_project_custom_fields_path(project)end- it 'does not show the invisible project custom fields' do+ it "does not show the invisible project custom fields" dowithin_custom_field_section_container(section_with_invisible_fields) do- expect(page).to have_content('Normal field')- expect(page).to have_no_content('Admin only field')+ expect(page).to have_content("Normal field")+ expect(page).to have_no_content("Admin only field")endend- it 'does not include the invisible project custom fields in the bulk actions' do+ it "does not include the invisible project custom fields in the bulk actions" dowithin_custom_field_section_container(section_with_invisible_fields) dopage.find("[data-test-selector='disable-all-project-custom-field-mappings-#{section_with_invisible_fields.id}']")@@ -461,11 +461,11 @@ RSpec.describe 'Projects custom fields mapping via project settings', :js, :withenddef expect_checked_state- expect(page).to have_css('.ToggleSwitch-statusOn')+ expect(page).to have_css(".ToggleSwitch-statusOn")enddef expect_unchecked_state- expect(page).to have_css('.ToggleSwitch-statusOff')+ expect(page).to have_css(".ToggleSwitch-statusOff")enddef within_custom_field_section_container(section, &)diff --git a/spec/features/work_packages/export_spec.rb b/spec/features/work_packages/export_spec.rbindex 74a44afc57f..a12ca3b8079 100644--- a/spec/features/work_packages/export_spec.rb+++ b/spec/features/work_packages/export_spec.rb@@ -234,15 +234,16 @@ RSpec.describe "work package export" doallow_any_instance_of(WorkPackage::PDFExport::WorkPackageListToPdf).to receive(:export!).and_return(- ::Exports::Result.new format: :pdf,- title: 'foo',- content: Tempfile.new("something"),- mime_type: "application/pdf"+ Exports::Result.new(format: :pdf,+ title: "foo",+ content: Tempfile.new("something"),+ mime_type: "application/pdf"))- end+ endcontext "table" dolet(:export_type) { I18n.t("export.format.pdf_overview_table") }+context "with many columns" dobefore do# Despite attempts to provoke the error by having a lot of columns, the pdf@@ -292,7 +293,7 @@ RSpec.describe "work package export" dowp_table.visit_query querywork_packages_page.ensure_loadedsettings_menu.open_and_choose "Export"- expect(page).not_to have_content(export_type)+ expect(page).to have_no_content(export_type)endend@@ -303,7 +304,7 @@ RSpec.describe "work package export" doit "has no gantt export" dowp_table.visit_query query_tlsettings_menu.open_and_choose "Export"- expect(page).not_to have_content(export_type)+ expect(page).to have_no_content(export_type)endenddiff --git a/spec/features/wysiwyg/macros/attribute_macros_spec.rb b/spec/features/wysiwyg/macros/attribute_macros_spec.rbindex 088ae194132..a1d8a7c6c9b 100644--- a/spec/features/wysiwyg/macros/attribute_macros_spec.rb+++ b/spec/features/wysiwyg/macros/attribute_macros_spec.rb@@ -31,34 +31,7 @@ require "spec_helper"RSpec.describe "Wysiwyg attribute macros", :js doshared_let(:admin) { create(:admin) }let(:user) { admin }-- shared_let(:type_milestone) { create(:type_milestone) }- shared_let(:type_task) { create(:type_task) }-- shared_let(:project) do- create(:project,- identifier: "some-project",- types: [type_milestone, type_task],- enabled_module_names: %w[wiki work_package_tracking])- end- shared_let(:work_package) do- create(:work_package,- subject: "Foo Bar",- project:,- start_date: '2023-01-01',- due_date: '2023-01-05',- type: type_task)- end- shared_let(:milestone) do- create(:work_package,- subject: "Milestone",- project:,- due_date: '2023-01-10',- type: type_milestone)- end-let(:editor) { Components::WysiwygEditor.new }-let(:markdown) do<<~MD# My headline@@ -100,6 +73,31 @@ RSpec.describe "Wysiwyg attribute macros", :js doMDend+ shared_let(:type_milestone) { create(:type_milestone) }+ shared_let(:type_task) { create(:type_task) }++ shared_let(:project) do+ create(:project,+ identifier: "some-project",+ types: [type_milestone, type_task],+ enabled_module_names: %w[wiki work_package_tracking])+ end+ shared_let(:work_package) do+ create(:work_package,+ subject: "Foo Bar",+ project:,+ start_date: "2023-01-01",+ due_date: "2023-01-05",+ type: type_task)+ end+ shared_let(:milestone) do+ create(:work_package,+ subject: "Milestone",+ project:,+ due_date: "2023-01-10",+ type: type_milestone)+ end+before dologin_as(user)enddiff --git a/spec/httpx_spec.rb b/spec/httpx_spec.rbindex 82208747e9e..7bb608bb09f 100644--- a/spec/httpx_spec.rb+++ b/spec/httpx_spec.rb@@ -1,16 +1,16 @@-require 'webrick'-require 'httpx'+require "webrick"+require "httpx"-RSpec.describe 'HTTPX' do- describe 'persistent connections' do- it 'does not hang forever when used to request HTTP 1.1 server' do- server = WEBrick::HTTPServer.new(:Port => 8543)- server.mount_proc '/' do |req, res|- res.body = 'Response Body'+RSpec.describe "HTTPX" do+ describe "persistent connections" do+ it "does not hang forever when used to request HTTP 1.1 server" do+ server = WEBrick::HTTPServer.new(Port: 8543)+ server.mount_proc "/" do |_req, res|+ res.body = "Response Body"endThread.new { server.start }- session = HTTPX .plugin(:persistent).with(timeout: {keep_alive_timeout: 2})+ session = HTTPX.plugin(:persistent).with(timeout: { keep_alive_timeout: 2 })number_of_requests_made = 0beginTimeout.timeout(10) dodiff --git a/spec/i18n_spec.rb b/spec/i18n_spec.rbindex 540315efb2c..b921ccc1ec6 100644--- a/spec/i18n_spec.rb+++ b/spec/i18n_spec.rb@@ -1,6 +1,6 @@# frozen_string_literal: true-require 'i18n/tasks'+require "i18n/tasks"RSpec.describe I18n dolet(:i18n) { I18n::Tasks::BaseTask.new }@@ -8,19 +8,19 @@ RSpec.describe I18n dolet(:unused_keys) { i18n.unused_keys }let(:inconsistent_interpolations) { i18n.inconsistent_interpolations }- it 'does not have missing keys' do- pending 'Enable when i18n-tasks is enabled across the project, otherwise this spec will report false positives'+ it "does not have missing keys" do+ pending "Enable when i18n-tasks is enabled across the project, otherwise this spec will report false positives"expect(missing_keys).to be_empty,"Missing #{missing_keys.leaves.count} i18n keys, run `i18n-tasks missing' to show them"end- it 'does not have unused keys' do+ it "does not have unused keys" doexpect(unused_keys).to be_empty,"#{unused_keys.leaves.count} unused i18n keys, run `i18n-tasks unused' to show them"end- it 'files are normalized' do+ it "files are normalized" donon_normalized = i18n.non_normalized_pathserror_message = "The following files need to be normalized:\n" \"#{non_normalized.map { |path| " #{path}" }.join("\n")}\n" \@@ -28,12 +28,12 @@ RSpec.describe I18n doexpect(non_normalized).to be_empty, error_messageend- context 'for all i18n files' do- let(:root_dir) { Pathname.new(__FILE__).dirname.join('..') }- let(:config_file) { root_dir.join('config/i18n-tasks-all-files.yml') }+ context "for all i18n files" do+ let(:root_dir) { Pathname.new(__FILE__).dirname.join("..") }+ let(:config_file) { root_dir.join("config/i18n-tasks-all-files.yml") }let(:i18n) { I18n::Tasks::BaseTask.new(config_file:) }- it 'does not have inconsistent interpolations' do+ it "does not have inconsistent interpolations" doconfig_file_relative_path = config_file.relative_path_from(Dir.pwd)error_message = "#{inconsistent_interpolations.leaves.count} i18n keys have inconsistent interpolations.\n" \"Run 'i18n-tasks check-consistent-interpolations --config #{config_file_relative_path}' to show them"diff --git a/spec/models/queries/projects/project_queries/scopes/allowed_to_spec.rb b/spec/models/queries/projects/project_queries/scopes/allowed_to_spec.rbindex bb6eb80ab6e..add53403ed2 100644--- a/spec/models/queries/projects/project_queries/scopes/allowed_to_spec.rb+++ b/spec/models/queries/projects/project_queries/scopes/allowed_to_spec.rb@@ -28,7 +28,7 @@require "spec_helper"-RSpec.describe Queries::Projects::ProjectQuery, "#allowed to" do # rubocop:disable RSpec/FilePath,RSpec/SpecFilePathFormat+RSpec.describe Queries::Projects::ProjectQuery, "#allowed to" do # rubocop:disable RSpec/RSpec/SpecFilePathFormatshared_let(:user) { create(:user) }shared_let(:other_user) { create(:user) }diff --git a/spec/models/work_package/work_package_acts_as_journalized_spec.rb b/spec/models/work_package/work_package_acts_as_journalized_spec.rbindex 58d2229e218..baf63383e10 100644--- a/spec/models/work_package/work_package_acts_as_journalized_spec.rb+++ b/spec/models/work_package/work_package_acts_as_journalized_spec.rb@@ -26,10 +26,10 @@# See COPYRIGHT and LICENSE files for more details.#++-require 'spec_helper'+require "spec_helper"RSpec.describe WorkPackage do- describe '#journal' do+ describe "#journal" dolet(:type) { create(:type) }let(:project) docreate(:project,@@ -42,7 +42,7 @@ RSpec.describe WorkPackage docreate(:work_package,project_id: project.id,type:,- description: 'Description',+ description: "Description",priority:,status:,duration: 1)@@ -52,53 +52,53 @@ RSpec.describe WorkPackage docurrent_user { create(:user) }- context 'for work package creation' do+ context "for work package creation" doit { expect(Journal.for_work_package.count).to eq(1) }- it 'has a journal entry' do+ it "has a journal entry" doexpect(Journal.for_work_package.first.journable).to eq(work_package)end- it 'notes the changes to subject' do+ it "notes the changes to subject" doexpect(work_package.last_journal.details[:subject]).to contain_exactly(nil, work_package.subject)end- it 'notes the changes to project' do+ it "notes the changes to project" doexpect(work_package.last_journal.details[:project_id]).to contain_exactly(nil, work_package.project_id)end- it 'notes the description' do+ it "notes the description" doexpect(work_package.last_journal.details[:description]).to contain_exactly(nil, work_package.description)end- it 'notes the scheduling mode' do+ it "notes the scheduling mode" doexpect(work_package.last_journal.details[:schedule_manually]).to contain_exactly(nil, false)end- it 'has the timestamp of the work package update time for created_at' do+ it "has the timestamp of the work package update time for created_at" doexpect(work_package.last_journal.created_at).to eql(work_package.reload.updated_at)end- it 'has the updated_at of the work package as the lower bound for validity_period and no upper bound' do+ it "has the updated_at of the work package as the lower bound for validity_period and no upper bound" doexpect(work_package.last_journal.validity_period).to eql(work_package.reload.updated_at...)endend- context 'when nothing is changed' do+ context "when nothing is changed" doit { expect { work_package.save! }.not_to change(Journal, :count) }- it 'does not update the updated_at time of the work package' do+ it "does not update the updated_at time of the work package" doexpect { work_package.save! }.not_to change(work_package, :updated_at)endend- context 'for different newlines', with_settings: { journal_aggregation_time_minutes: 0 } do+ context "for different newlines", with_settings: { journal_aggregation_time_minutes: 0 } dolet(:description) { "Description\n\nwith newlines\n\nembedded" }let(:changed_description) { description.gsub("\n", "\r\n") }let!(:work_package1) do@@ -113,19 +113,19 @@ RSpec.describe WorkPackage dowork_package1.description = changed_descriptionend- context 'when a new journal is created tracking a simultaneously applied change' do+ context "when a new journal is created tracking a simultaneously applied change" dobefore do- work_package1.subject += 'changed'+ work_package1.subject += "changed"work_package1.save!end- describe 'does not track the changed newline characters' do+ describe "does not track the changed newline characters" dosubject { work_package1.last_journal.data.description }it { is_expected.to eq(description) }end- describe 'tracks only the other change' do+ describe "tracks only the other change" dosubject { work_package1.last_journal.details }it { is_expected.to have_key :subject }@@ -133,7 +133,7 @@ RSpec.describe WorkPackage doendend- context 'when there is a legacy journal containing non-escaped newlines' do+ context "when there is a legacy journal containing non-escaped newlines" dolet!(:work_package1) docreate(:work_package,journals: {@@ -142,13 +142,13 @@ RSpec.describe WorkPackage do})end- it 'does not track the change to the newline characters' do+ it "does not track the change to the newline characters" doexpect(work_package1.reload.last_journal.details).not_to have_key :descriptionendendend- describe 'on work package change without aggregation', with_settings: { journal_aggregation_time_minutes: 0 } do+ describe "on work package change without aggregation", with_settings: { journal_aggregation_time_minutes: 0 } dolet(:parent_work_package) docreate(:work_package,project_id: project.id,@@ -162,8 +162,8 @@ RSpec.describe WorkPackage dobefore doproject.types << type2- work_package.subject = 'changed'- work_package.description = 'changed'+ work_package.subject = "changed"+ work_package.description = "changed"work_package.type = type2work_package.status = status2work_package.priority = priority2@@ -179,10 +179,10 @@ RSpec.describe WorkPackage dowork_package.save!end- context 'for last created journal' do+ context "for last created journal" dosubject { work_package.last_journal.details }- it 'contains all changes' do+ it "contains all changes" do%i(subject description type_id status_id priority_idstart_date due_date estimated_hours assigned_to_idresponsible_id parent_id schedule_manually duration).each do |a|@@ -191,106 +191,106 @@ RSpec.describe WorkPackage doendend- shared_examples_for 'old value' do+ shared_examples_for "old value" dosubject { work_package.last_journal.old_value_for(property) }it { is_expected.to eq(expected_value) }end- shared_examples_for 'new value' do+ shared_examples_for "new value" dosubject { work_package.last_journal.new_value_for(property) }it { is_expected.to eq(expected_value) }end- describe 'journaled value for' do- describe 'description' do- let(:property) { 'description' }+ describe "journaled value for" do+ describe "description" do+ let(:property) { "description" }- context 'for old value' do- let(:expected_value) { 'Description' }+ context "for old value" do+ let(:expected_value) { "Description" }- it_behaves_like 'old value'+ it_behaves_like "old value"end- context 'for new value' do- let(:expected_value) { 'changed' }+ context "for new value" do+ let(:expected_value) { "changed" }- it_behaves_like 'new value'+ it_behaves_like "new value"endend- describe 'schedule_manually' do- let(:property) { 'schedule_manually' }+ describe "schedule_manually" do+ let(:property) { "schedule_manually" }- context 'for old value' do+ context "for old value" dolet(:expected_value) { false }- it_behaves_like 'old value'+ it_behaves_like "old value"end- context 'for new value' do+ context "for new value" dolet(:expected_value) { true }- it_behaves_like 'new value'+ it_behaves_like "new value"endend- describe 'duration' do- let(:property) { 'duration' }+ describe "duration" do+ let(:property) { "duration" }- context 'for old value' do+ context "for old value" dolet(:expected_value) { 1 }- it_behaves_like 'old value'+ it_behaves_like "old value"end- context 'for new value' do+ context "for new value" dolet(:expected_value) { 8 }- it_behaves_like 'new value'+ it_behaves_like "new value"endendend- describe 'adding journal with a missing journal and an existing journal' do+ describe "adding journal with a missing journal and an existing journal" dobefore doallow(WorkPackages::UpdateContract).to receive(:new).and_return(NoopContract.new)service = WorkPackages::UpdateService.new(user: current_user, model: work_package)- service.call(journal_notes: 'note to be deleted', send_notifications: false)+ service.call(journal_notes: "note to be deleted", send_notifications: false)work_package.reload- service.call(description: 'description v2', send_notifications: false)+ service.call(description: "description v2", send_notifications: false)work_package.reload- work_package.journals.reload.find_by(notes: 'note to be deleted').delete+ work_package.journals.reload.find_by(notes: "note to be deleted").delete- service.call(description: 'description v4', send_notifications: false)+ service.call(description: "description v4", send_notifications: false)end- it 'creates a journal for the last change' do+ it "creates a journal for the last change" dolast_journal = work_package.last_journal- expect(last_journal.data.description).to eql('description v4')+ expect(last_journal.data.description).to eql("description v4")endend- it 'has the timestamp of the work package update time for created_at' do+ it "has the timestamp of the work package update time for created_at" doexpect(work_package.last_journal.created_at).to eql(work_package.reload.updated_at)end- it 'has the updated_at of the work package as the lower bound for validity_period and no upper bound' do+ it "has the updated_at of the work package as the lower bound for validity_period and no upper bound" doexpect(work_package.last_journal.validity_period).to eql(work_package.reload.updated_at...)end- it 'sets the upper bound of the preceeding journal to be the created_at time of the newly created journal' do+ it "sets the upper bound of the preceeding journal to be the created_at time of the newly created journal" doformer_last_journal = work_package.journals[-2]expect(former_last_journal.validity_period).to eql(former_last_journal.created_at...work_package.last_journal.created_at)endend- describe 'attachments', with_settings: { journal_aggregation_time_minutes: 0 } do+ describe "attachments", with_settings: { journal_aggregation_time_minutes: 0 } dolet(:attachment) { build(:attachment) }let(:attachment_id) { "attachments_#{attachment.id}" }@@ -299,7 +299,7 @@ RSpec.describe WorkPackage dowork_package.save!end- context 'for new attachment' do+ context "for new attachment" dosubject { work_package.last_journal.details }it { is_expected.to have_key attachment_id }@@ -307,22 +307,22 @@ RSpec.describe WorkPackage doit { expect(subject[attachment_id]).to eq([nil, attachment.filename]) }end- context 'when attachment saved w/o change' do+ context "when attachment saved w/o change" doit { expect { attachment.save! }.not_to change(Journal, :count) }endend- describe 'custom values', with_settings: { journal_aggregation_time_minutes: 0 } do+ describe "custom values", with_settings: { journal_aggregation_time_minutes: 0 } dolet(:custom_field) { create(:work_package_custom_field) }let(:custom_value) dobuild(:custom_value,- value: 'false',+ value: "false",custom_field:)endlet(:custom_field_id) { "custom_fields_#{custom_value.custom_field_id}" }- shared_context 'for work package with custom value' do+ shared_context "for work package with custom value" dobefore doproject.work_package_custom_fields << custom_fieldtype.custom_fields << custom_field@@ -332,8 +332,8 @@ RSpec.describe WorkPackage doendend- context 'for new custom value' do- include_context 'for work package with custom value'+ context "for new custom value" do+ include_context "for work package with custom value"subject { work_package.last_journal.details }@@ -342,12 +342,12 @@ RSpec.describe WorkPackage doit { expect(subject[custom_field_id]).to eq([nil, custom_value.value]) }end- context 'for custom value modified' do- include_context 'for work package with custom value'+ context "for custom value modified" do+ include_context "for work package with custom value"let(:modified_custom_value) docreate(:work_package_custom_value,- value: 'true',+ value: "true",custom_field:)end@@ -363,12 +363,12 @@ RSpec.describe WorkPackage doit { expect(subject[custom_field_id]).to eq([custom_value.value.to_s, modified_custom_value.value.to_s]) }end- context 'when work package saved w/o change' do- include_context 'for work package with custom value'+ context "when work package saved w/o change" do+ include_context "for work package with custom value"let(:unmodified_custom_value) docreate(:work_package_custom_value,- value: 'false',+ value: "false",custom_field:)end@@ -378,15 +378,15 @@ RSpec.describe WorkPackage doit { expect { work_package.save! }.not_to change(Journal, :count) }- it 'does not set an upper bound to the already existing journal' do+ it "does not set an upper bound to the already existing journal" dowork_package.saveexpect(work_package.last_journal.validity_period.end).to be_nilendend- context 'when custom value removed' do- include_context 'for work package with custom value'+ context "when custom value removed" do+ include_context "for work package with custom value"before dowork_package.custom_values.delete(custom_value)@@ -400,35 +400,35 @@ RSpec.describe WorkPackage doit { expect(subject[custom_field_id]).to eq([custom_value.value, nil]) }end- context 'when custom value did not exist before' do+ context "when custom value did not exist before" dolet(:custom_field) docreate(:work_package_custom_field,is_required: false,- field_format: 'list',- possible_values: ['', '1', '2', '3', '4', '5', '6', '7'])+ field_format: "list",+ possible_values: ["", "1", "2", "3", "4", "5", "6", "7"])endlet(:custom_value) docreate(:custom_value,- value: '',+ value: "",customized: work_package,custom_field:)end- describe 'empty values are recognized as unchanged' do- include_context 'for work package with custom value'+ describe "empty values are recognized as unchanged" do+ include_context "for work package with custom value"it { expect(work_package.last_journal.customizable_journals).to be_empty }end- describe 'empty values handled as non existing' do- include_context 'for work package with custom value'+ describe "empty values handled as non existing" do+ include_context "for work package with custom value"it { expect(work_package.last_journal.customizable_journals.count).to eq(0) }endendend- describe 'file_links', with_settings: { journal_aggregation_time_minutes: 0 } do+ describe "file_links", with_settings: { journal_aggregation_time_minutes: 0 } dolet(:file_link) { build(:file_link) }let(:file_link_id) { "file_links_#{file_link.id}" }@@ -437,18 +437,18 @@ RSpec.describe WorkPackage dowork_package.save!end- context 'for the new file link' do+ context "for the new file link" dosubject(:journal_details) { work_package.last_journal.details }it { is_expected.to have_key file_link_id }it {expect(journal_details[file_link_id])- .to eq([nil, { 'link_name' => file_link.origin_name, 'storage_name' => nil }])+ .to eq([nil, { "link_name" => file_link.origin_name, "storage_name" => nil }])}end- context 'when file link saved w/o change' do+ context "when file link saved w/o change" doit {expect dofile_link.save@@ -458,56 +458,56 @@ RSpec.describe WorkPackage doendend- context 'for only journal notes adding' do+ context "for only journal notes adding" dosubject do- work_package.add_journal(user: User.current, notes: 'some notes')+ work_package.add_journal(user: User.current, notes: "some notes")work_package.savework_packageend- it 'does not create a new journal entry' do+ it "does not create a new journal entry" doexpect { subject }.not_to change(work_package, :last_journal)end- it 'has the timestamp of the work package update time for updated_at' do+ it "has the timestamp of the work package update time for updated_at" doexpect(subject.last_journal.updated_at).to eql(work_package.reload.updated_at)end- it 'updates the updated_at time of the work package' do+ it "updates the updated_at time of the work package" doexpect { subject.reload }.to change(work_package, :updated_at)end- it 'stores the note with the existing journal entry' do- expect { subject }.to change { work_package.last_journal.notes }.from('').to('some notes')+ it "stores the note with the existing journal entry" do+ expect { subject }.to change { work_package.last_journal.notes }.from("").to("some notes")endend- context 'for mixed journal notes and attribute adding' do+ context "for mixed journal notes and attribute adding" dosubject do- work_package.add_journal(user: User.current, notes: 'some notes')- work_package.subject = 'blubs'+ work_package.add_journal(user: User.current, notes: "some notes")+ work_package.subject = "blubs"work_package.savework_packageend- it 'does not create a new journal entry' do+ it "does not create a new journal entry" doexpect { subject }.not_to change(work_package, :last_journal)end- it 'has the timestamp of the work package update time for updated_at' do+ it "has the timestamp of the work package update time for updated_at" doexpect(subject.last_journal.updated_at).to eql(work_package.reload.updated_at)end- it 'updates the updated_at time of the work package' do+ it "updates the updated_at time of the work package" doexpect { subject.reload }.to change(work_package, :updated_at)end- it 'stores the note with the existing journal entry' do- expect { subject }.to change { work_package.last_journal.notes }.from('').to('some notes')+ it "stores the note with the existing journal entry" do+ expect { subject }.to change { work_package.last_journal.notes }.from("").to("some notes")endend- context 'for only journal cause adding' do+ context "for only journal cause adding" dosubject dowork_package.add_journal(user: User.current,@@ -517,62 +517,62 @@ RSpec.describe WorkPackage dowork_packageend- it 'has the cause logged in the last journal' do+ it "has the cause logged in the last journal" doexpect(subject.last_journal.cause).to eql({- 'type' => 'work_package_predecessor_changed_times',- 'work_package_id' => other_work_package.id+ "type" => "work_package_predecessor_changed_times",+ "work_package_id" => other_work_package.id})end- it 'has the timestamp of the work package update time for created_at' do+ it "has the timestamp of the work package update time for created_at" doexpect(subject.last_journal.updated_at).to eql(work_package.reload.updated_at)end- it 'updates the updated_at time of the work package' do+ it "updates the updated_at time of the work package" doexpect { subject.reload }.to change(work_package, :updated_at)end- it 'does create a new journal entry' do+ it "does create a new journal entry" doexpect { subject }.to change(work_package, :last_journal)endend- context 'for mixed journal cause, notes and attribute adding' do+ context "for mixed journal cause, notes and attribute adding" dosubject dowork_package.add_journal(user: User.current,- notes: 'some notes',+ notes: "some notes",cause: Journal::CausedByWorkPackagePredecessorChange.new(other_work_package))- work_package.subject = 'blubs'+ work_package.subject = "blubs"work_package.savework_packageend- it 'has the timestamp of the work package update time for created_at' do+ it "has the timestamp of the work package update time for created_at" doexpect(work_package.last_journal.updated_at).to eql(work_package.reload.updated_at)end- it 'does create a new journal entry' do+ it "does create a new journal entry" doexpect { subject }.to change(work_package, :last_journal)end- it 'updates the updated_at time of the work package' do+ it "updates the updated_at time of the work package" doupdated_at_before = work_package.updated_atexpect(subject.reload.updated_at).not_to eql(updated_at_before)end- it 'stores the cause and note with the existing journal entry' do+ it "stores the cause and note with the existing journal entry" dosubject- expect(work_package.last_journal.notes).to eq('some notes')- expect(work_package.last_journal.cause_type).to eq('work_package_predecessor_changed_times')+ expect(work_package.last_journal.notes).to eq("some notes")+ expect(work_package.last_journal.cause_type).to eq("work_package_predecessor_changed_times")expect(work_package.last_journal.cause_work_package_id).to eq(other_work_package.id)endend- context 'when 2 updates with the same cause occur' do+ context "when 2 updates with the same cause occur" dobefore dowork_package.add_journal(user: User.current,@@ -591,20 +591,20 @@ RSpec.describe WorkPackage dowork_package.saveend- it 'does not create a new journal entry' do+ it "does not create a new journal entry" doexpect { subject }.not_to change(work_package, :last_journal)end- it 'stores the last update only' do+ it "stores the last update only" dosubject- expect(work_package.last_journal.new_value_for(:subject)).to eq('new subject 2')- expect(work_package.last_journal.cause_type).to eq('work_package_predecessor_changed_times')+ expect(work_package.last_journal.new_value_for(:subject)).to eq("new subject 2")+ expect(work_package.last_journal.cause_type).to eq("work_package_predecessor_changed_times")expect(work_package.last_journal.cause_work_package_id).to eq(other_work_package.id)endend- context 'when updated within aggregation time' do+ context "when updated within aggregation time" dosubject(:journals) { work_package.journals }current_user { user1 }@@ -627,18 +627,18 @@ RSpec.describe WorkPackage dowork_package.save!end- context 'as author of last change' do+ context "as author of last change" dolet(:new_author) { user1 }- it 'leads to a single journal' do+ it "leads to a single journal" doexpect(subject.count).to be 1end- it 'is the initial journal' do+ it "is the initial journal" doexpect(subject.first).to be_initialend- it 'contains the changes of both updates with the later overwriting the former' do+ it "contains the changes of both updates with the later overwriting the former" doexpect(subject.first.data.status_id).to eql changes[:status].id@@ -646,51 +646,51 @@ RSpec.describe WorkPackage do.to eql work_package.type_idend- context 'with a comment' do- let(:notes) { 'This is why I changed it.' }+ context "with a comment" do+ let(:notes) { "This is why I changed it." }- it 'leads to a single journal with the comment' do+ it "leads to a single journal with the comment" doexpect(subject.count).to be 1expect(subject.first.notes).to eql notesend- context 'when adding a second comment' do- let(:second_notes) { 'Another comment, unrelated to the first one.' }+ context "when adding a second comment" do+ let(:second_notes) { "Another comment, unrelated to the first one." }before dowork_package.add_journal(user: new_author, notes: second_notes)work_package.save!end- it 'returns two journals' do+ it "returns two journals" doexpect(subject.count).to be 2expect(subject.first.notes).to eql notesexpect(subject.second.notes).to eql second_notesend- it 'has one initial journal and one non-initial journal' do+ it "has one initial journal and one non-initial journal" doexpect(subject.first).to be_initialexpect(subject.second).not_to be_initialendend- context 'when adding another change without comment' do+ context "when adding another change without comment" dobefore dowork_package.reload # need to update the lock_version, avoiding StaleObjectError- work_package.subject = 'foo'+ work_package.subject = "foo"work_package.assigned_to = current_userwork_package.save!end- it 'leads to a single journal with the comment of the replaced journal and the state both combined' do+ it "leads to a single journal with the comment of the replaced journal and the state both combined" doexpect(subject.count).to eq 1expect(subject.first.notes).to eql notesexpect(subject.first.data.subject)- .to eql 'foo'+ .to eql "foo"expect(subject.first.data.assigned_to).to eql current_user@@ -700,16 +700,16 @@ RSpec.describe WorkPackage doendend- context 'when adding another change with a customized work package' do+ context "when adding another change with a customized work package" dolet(:custom_field) docreate(:work_package_custom_field,is_required: false,- field_format: 'list',- possible_values: ['', '1', '2', '3', '4', '5', '6', '7'])+ field_format: "list",+ possible_values: ["", "1", "2", "3", "4", "5", "6", "7"])endlet(:custom_value) docreate(:custom_value,- value: custom_field.custom_options.find { |co| co.value == '1' }.try(:id),+ value: custom_field.custom_options.find { |co| co.value == "1" }.try(:id),customized: work_package,custom_field:)end@@ -717,66 +717,66 @@ RSpec.describe WorkPackage dobefore docustom_valuework_package.reload # need to update the lock_version, avoiding StaleObjectError- work_package.subject = 'foo'+ work_package.subject = "foo"work_package.save!end- it 'leads to a single journal with only one customizable journal' do+ it "leads to a single journal with only one customizable journal" doexpect(subject.count).to eq 1expect(subject.first.notes).to eql notesexpect(subject.first.data.subject)- .to eql 'foo'+ .to eql "foo"expect(subject.first.customizable_journals.count).to eq(1)endendend- it 'has the journal\'s creation time as the lower and no upper bound for validity_period' do+ it "has the journal's creation time as the lower and no upper bound for validity_period" doexpect(work_package.last_journal.validity_period).to eql(work_package.last_journal.created_at...)endend- context 'with a different author' do+ context "with a different author" dolet(:new_author) { user2 }- it 'leads to two journals' do+ it "leads to two journals" doexpect(subject.count).to be 2end- it 'has the initial user as the author of the first journal' do+ it "has the initial user as the author of the first journal" doexpect(subject.first.user).to eql current_userend- it 'has the second user as he author of the second journal' do+ it "has the second user as he author of the second journal" doexpect(subject.second.user).to eql new_authorend- it 'has the changes (compared to the initial state) in the second journal' do+ it "has the changes (compared to the initial state) in the second journal" doexpect(subject.second.get_changes).to eql("status_id" => [status.id, new_status.id])end- it 'has the first journal\'s creation time as the lower and the second journal\'s creation time ' \- 'as the upper bound for validity_period of the first journal' do+ it "has the first journal's creation time as the lower and the second journal's creation time " \+ "as the upper bound for validity_period of the first journal" doexpect(subject.first.validity_period).to eql(subject.first.created_at...subject.second.created_at)end- it 'has the second journal\'s creation time as the lower and no upper bound for validity_period of the second journal' do+ it "has the second journal's creation time as the lower and no upper bound for validity_period of the second journal" doexpect(subject.second.validity_period).to eql(subject.second.created_at...)endendend- context 'when updated after aggregation timeout expired', with_settings: { journal_aggregation_time_minutes: 1 } do+ context "when updated after aggregation timeout expired", with_settings: { journal_aggregation_time_minutes: 1 } dolet(:last_update_time) { 2.minutes.ago }subject(:journals) { work_package.journals }@@ -792,38 +792,38 @@ RSpec.describe WorkPackage dowork_package.save!end- it 'creates a new journal' do+ it "creates a new journal" doexpect(journals.count).to be 2end- it 'has the first journal\'s creation time as the lower and the second journal\'s creation time ' \- 'as the upper bound for validity_period of the first journal' do+ it "has the first journal's creation time as the lower and the second journal's creation time " \+ "as the upper bound for validity_period of the first journal" doexpect(subject.first.validity_period).to eql(subject.first.created_at...subject.second.created_at)end- it 'has the second journal\'s creation time as the lower and no upper bound for validity_period of the second journal' do+ it "has the second journal's creation time as the lower and no upper bound for validity_period of the second journal" doexpect(subject.second.validity_period).to eql(subject.second.created_at...)endend- context 'when updating with aggregation disabled', with_settings: { journal_aggregation_time_minutes: 0 } do+ context "when updating with aggregation disabled", with_settings: { journal_aggregation_time_minutes: 0 } dosubject(:journals) { work_package.journals }- context 'when WP updated within milliseconds' do+ context "when WP updated within milliseconds" dobefore dowork_package.status = build(:status)work_package.save!end- it 'creates a new journal' do+ it "creates a new journal" doexpect(journals.count).to be 2endendend- context 'when aggregation leads to an empty change (changing back and forth)',+ context "when aggregation leads to an empty change (changing back and forth)",with_settings: { journal_aggregation_time_minutes: 1 } dolet!(:work_package) doUser.execute_as current_user do@@ -832,7 +832,7 @@ RSpec.describe WorkPackage docreated_at: 5.minutes.ago,project_id: project.id,type:,- description: 'Description',+ description: "Description",priority:,status:,duration: 1)@@ -848,17 +848,17 @@ RSpec.describe WorkPackage dowork_package.save!end- it 'creates a new journal' do+ it "creates a new journal" doexpect(work_package.journals.count).to be 2end- it 'has the old state in the last journal`s data' do+ it "has the old state in the last journal`s data" doexpect(work_package.journals.last.data.status_id).to be status.idendendend- describe '#destroy' do+ describe "#destroy" dolet(:project) { create(:project) }let(:type) { create(:type) }let(:custom_field) do@@ -887,27 +887,27 @@ RSpec.describe WorkPackage dowork_package.destroyend- it 'removes the journal' do+ it "removes the journal" doexpect(Journal.find_by(id: journal.id)).to be_nilend- it 'removes the journal data' do+ it "removes the journal data" doexpect(Journal::WorkPackageJournal.find_by(id: journal.data_id)).to be_nilend- it 'removes the customizable journals' do+ it "removes the customizable journals" doexpect(Journal::CustomizableJournal.find_by(id: customizable_journals.map(&:id))).to be_nilend- it 'removes the attachable journals' do+ it "removes the attachable journals" doexpect(Journal::AttachableJournal.find_by(id: attachable_journals.map(&:id))).to be_nilend- it 'removes the storable journals' do+ it "removes the storable journals" doexpect(Journal::StorableJournal.find_by(id: attachable_journals.map(&:id))).to be_nilenddiff --git a/spec/services/projects/copy_service_integration_spec.rb b/spec/services/projects/copy_service_integration_spec.rbindex 6e3e43935cf..513e95ec1d8 100644--- a/spec/services/projects/copy_service_integration_spec.rb+++ b/spec/services/projects/copy_service_integration_spec.rb@@ -188,9 +188,9 @@ RSpec.describe(endend- context 'with disabled project custom fields with default value' do- it 'is still disabled in the copy' do- create(:text_project_custom_field, default_value: 'default value')+ context "with disabled project custom fields with default value" do+ it "is still disabled in the copy" do+ create(:text_project_custom_field, default_value: "default value")expect(subject).to be_successdiff --git a/spec/services/users/drop_tokens_service_spec.rb b/spec/services/users/drop_tokens_service_spec.rbindex 5a4c93c030c..84b08f92628 100644--- a/spec/services/users/drop_tokens_service_spec.rb+++ b/spec/services/users/drop_tokens_service_spec.rb@@ -33,6 +33,7 @@ RSpec.describe Users::DropTokensService, type: :model doshared_let(:other_user) { create(:user) }let(:instance) { described_class.new(current_user: input_user) }+subject { instance.call! }describe "Invitation token" dodiff --git a/spec/services/work_packages/set_schedule_service_spec.rb b/spec/services/work_packages/set_schedule_service_spec.rbindex cbae618927a..65e0f35d113 100644--- a/spec/services/work_packages/set_schedule_service_spec.rb+++ b/spec/services/work_packages/set_schedule_service_spec.rb@@ -26,14 +26,14 @@# See COPYRIGHT and LICENSE files for more details.#++-require 'spec_helper'+require "spec_helper"RSpec.describe WorkPackages::SetScheduleService docreate_shared_association_defaults_for_work_package_factorylet(:work_package) docreate(:work_package,- subject: 'subject',+ subject: "subject",start_date: work_package_start_date,due_date: work_package_due_date)end@@ -123,17 +123,17 @@ RSpec.describe WorkPackages::SetScheduleService dosubject { instance.call(attributes) }- shared_examples_for 'reschedules' do+ shared_examples_for "reschedules" dobefore dosubjectend- it 'is success' do+ it "is success" doexpect(subject).to be_successend- it 'updates the following work packages' do+ it "updates the following work packages" doexpected.each do |wp, (start_date, due_date)|expected_cause_type = "work_package_related_changed_times"result = subject.all_results.find { |result_wp| result_wp.id == wp.id }@@ -168,87 +168,87 @@ RSpec.describe WorkPackages::SetScheduleService doendend- it 'returns only the original and the changed work packages' do+ it "returns only the original and the changed work packages" doexpect(subject.all_results).to match_array expected.keys + [work_package]endend- shared_examples_for 'does not reschedule' do+ shared_examples_for "does not reschedule" dobefore dosubjectend- it 'is success' do+ it "is success" doexpect(subject).to be_successend- it 'does not change any other work packages' do+ it "does not change any other work packages" doexpect(subject.all_results).to contain_exactly(work_package)end- it 'does not assign a journal cause' do+ it "does not assign a journal cause" dosubject.all_results.each do |work_package|expect(work_package.journal_cause).to be_blankendendend- context 'without relation' do- it 'is success' do+ context "without relation" do+ it "is success" doexpect(subject).to be_successendend- context 'with a single successor' do+ context "with a single successor" dolet!(:following) do[following_work_package1]end- context 'when moving forward' do+ context "when moving forward" dobefore dowork_package.due_date = Time.zone.today + 5.daysend- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [Time.zone.today + 6.days, Time.zone.today + 8.days] }endendend- context 'when moving forward with the follower having no due date' do+ context "when moving forward with the follower having no due date" dolet(:follower1_due_date) { nil }before dowork_package.due_date = Time.zone.today + 5.daysend- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [Time.zone.today + 6.days, nil] }endendend- context 'when moving forward with the follower having no start date' do+ context "when moving forward with the follower having no start date" dolet(:follower1_start_date) { nil }before dowork_package.due_date = Time.zone.today + 5.daysend- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [Time.zone.today + 6.days, Time.zone.today + 6.days] }endendend- context 'when moving forward with the follower having some space left' do+ context "when moving forward with the follower having some space left" dolet(:follower1_start_date) { Time.zone.today + 3.days }let(:follower1_due_date) { Time.zone.today + 5.days }@@ -256,14 +256,14 @@ RSpec.describe WorkPackages::SetScheduleService dowork_package.due_date = Time.zone.today + 5.daysend- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [Time.zone.today + 6.days, Time.zone.today + 8.days] }endendend- context 'when moving forward with the follower having enough space left to not be moved at all' do+ context "when moving forward with the follower having enough space left to not be moved at all" dolet(:follower1_start_date) { Time.zone.today + 10.days }let(:follower1_due_date) { Time.zone.today + 12.days }@@ -271,10 +271,10 @@ RSpec.describe WorkPackages::SetScheduleService dowork_package.due_date = Time.zone.today + 5.daysend- it_behaves_like 'does not reschedule'+ it_behaves_like "does not reschedule"end- context 'when moving forward with the follower having some space left and a lag' do+ context "when moving forward with the follower having some space left and a lag" dolet(:follower1_start_date) { Time.zone.today + 5.days }let(:follower1_due_date) { Time.zone.today + 7.days }let(:follower1_lag) { 3 }@@ -283,14 +283,14 @@ RSpec.describe WorkPackages::SetScheduleService dowork_package.due_date = Time.zone.today + 5.daysend- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [Time.zone.today + 9.days, Time.zone.today + 11.days] }endendend- context 'when moving forward with the follower not needing to be moved' do+ context "when moving forward with the follower not needing to be moved" dolet(:follower1_start_date) { Time.zone.today + 6.days }let(:follower1_due_date) { Time.zone.today + 8.days }@@ -298,18 +298,18 @@ RSpec.describe WorkPackages::SetScheduleService dowork_package.due_date = Time.zone.today + 5.daysend- it_behaves_like 'does not reschedule'+ it_behaves_like "does not reschedule"end- context 'when moving backwards' do+ context "when moving backwards" dobefore dowork_package.due_date = Time.zone.today - 5.daysend- it_behaves_like 'does not reschedule'+ it_behaves_like "does not reschedule"end- context 'when moving backwards with space between' do+ context "when moving backwards with space between" dolet(:follower1_start_date) { Time.zone.today + 3.days }let(:follower1_due_date) { Time.zone.today + 5.days }@@ -317,7 +317,7 @@ RSpec.describe WorkPackages::SetScheduleService dowork_package.due_date = Time.zone.today - 5.daysend- it_behaves_like 'does not reschedule'+ it_behaves_like "does not reschedule"endcontext 'when moving backwards with the follower having no start date (which should not happen) \@@ -328,7 +328,7 @@ RSpec.describe WorkPackages::SetScheduleService dowork_package.due_date = Time.zone.today - 5.daysend- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [Time.zone.today - 4.days, follower1_due_date] }end@@ -343,82 +343,82 @@ RSpec.describe WorkPackages::SetScheduleService dowork_package.due_date = follower1_due_date + 5.daysend- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [follower1_due_date + 6.days, follower1_due_date + 6.days] }endendend- context 'when removing the dates on the predecessor' do+ context "when removing the dates on the predecessor" dobefore dowork_package.start_date = work_package.due_date = nilend# The follower will keep its dates- it_behaves_like 'does not reschedule'+ it_behaves_like "does not reschedule"- context 'when the follower has no start date but a due date' do+ context "when the follower has no start date but a due date" dolet(:follower1_start_date) { nil }let(:follower1_due_date) { Time.zone.today + 15.days }- it_behaves_like 'does not reschedule'+ it_behaves_like "does not reschedule"endend- context 'when not moving and the successor not having start & due date (e.g. creating relation)' do+ context "when not moving and the successor not having start & due date (e.g. creating relation)" dolet(:follower1_start_date) { nil }let(:follower1_due_date) { nil }- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [work_package.due_date + 1.day, nil] }endendend- context 'when not moving and the successor having due before predecessor due date (e.g. creating relation)' do+ context "when not moving and the successor having due before predecessor due date (e.g. creating relation)" dolet(:follower1_start_date) { nil }let(:follower1_due_date) { work_package_due_date - 5.days }- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [work_package.due_date + 1.day, work_package.due_date + 1.day] }endendend- context 'when not moving and the successor having start before predecessor due date (e.g. creating relation)' do+ context "when not moving and the successor having start before predecessor due date (e.g. creating relation)" dolet(:follower1_start_date) { work_package_due_date - 5.days }let(:follower1_due_date) { nil }- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [work_package.due_date + 1.day, nil] }endendend- context 'when not moving and the successor having start and due before predecessor due date (e.g. creating relation)' do+ context "when not moving and the successor having start and due before predecessor due date (e.g. creating relation)" dolet(:follower1_start_date) { work_package_due_date - 5.days }let(:follower1_due_date) { work_package_due_date - 2.days }- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [work_package.due_date + 1.day, work_package.due_date + 4.days] }endendend- context 'when not having dates and the successor not having start & due date (e.g. creating relation)' do+ context "when not having dates and the successor not having start & due date (e.g. creating relation)" dolet(:work_package_due_date) { nil }let(:follower1_start_date) { nil }let(:follower1_due_date) { nil }- it_behaves_like 'does not reschedule'+ it_behaves_like "does not reschedule"end- context 'with the successor having another predecessor which has no dates' do+ context "with the successor having another predecessor which has no dates" dolet(:following_work_package1) docreate_follower(follower1_start_date,follower1_due_date,@@ -431,29 +431,29 @@ RSpec.describe WorkPackages::SetScheduleService dodue_date: nil)end- context 'when moving forward' do+ context "when moving forward" dobefore dowork_package.due_date = Time.zone.today + 5.daysend- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [Time.zone.today + 6.days, Time.zone.today + 8.days] }endendend- context 'when moving backwards' do+ context "when moving backwards" dobefore dowork_package.due_date = Time.zone.today - 5.daysend- it_behaves_like 'does not reschedule'+ it_behaves_like "does not reschedule"endendend- context 'with only a parent' do+ context "with only a parent" dolet!(:parent_work_package) docreate(:work_package).tap do |parent|work_package.parent = parent@@ -462,14 +462,14 @@ RSpec.describe WorkPackages::SetScheduleService doendlet(:work_package_start_date) { Time.zone.today - 5.days }- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ parent_work_package => [work_package_start_date, work_package_due_date] }endendend- context 'with a parent having a follower' do+ context "with a parent having a follower" dolet(:work_package_start_date) { Time.zone.today }let(:work_package_due_date) { Time.zone.today + 5.days }let!(:parent_work_package) do@@ -487,7 +487,7 @@ RSpec.describe WorkPackages::SetScheduleService do{ parent_work_package => 0 })end- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ parent_work_package => [work_package_start_date, work_package_due_date],follower_of_parent_work_package => [work_package_due_date + 1.day, work_package_due_date + 3.days] }@@ -514,7 +514,7 @@ RSpec.describe WorkPackages::SetScheduleService do## That's why the WorkPackage.for_scheduling call is mocked to customize# the order of the returned work_packages to reproduce this bug.- context 'with also a sibling follower with same parent' do+ context "with also a sibling follower with same parent" dolet!(:sibling_follower_of_work_package) docreate_follower(Time.zone.today + 2.days,Time.zone.today + 3.days,@@ -531,7 +531,7 @@ RSpec.describe WorkPackages::SetScheduleService doendend- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ sibling_follower_of_work_package => [work_package_due_date + 1.day, work_package_due_date + 2.days],parent_work_package => [work_package_start_date, work_package_due_date + 2.days],@@ -541,18 +541,18 @@ RSpec.describe WorkPackages::SetScheduleService doendend- context 'with a single successor having a parent' do+ context "with a single successor having a parent" dolet!(:following) do[following_work_package1,parent_following_work_package1]end- context 'when moving forward' do+ context "when moving forward" dobefore dowork_package.due_date = Time.zone.today + 5.daysend- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [Time.zone.today + 6.days, Time.zone.today + 8.days],parent_following_work_package1 => [Time.zone.today + 6.days, Time.zone.today + 8.days] }@@ -560,7 +560,7 @@ RSpec.describe WorkPackages::SetScheduleService doendend- context 'when moving forward with the parent having another child not being moved' do+ context "when moving forward with the parent having another child not being moved" dolet(:parent_follower1_start_date) { follower1_start_date }let(:parent_follower1_due_date) { follower1_due_date + 4.days }@@ -574,7 +574,7 @@ RSpec.describe WorkPackages::SetScheduleService dowork_package.due_date = Time.zone.today + 5.daysend- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [Time.zone.today + 6.days, Time.zone.today + 8.days],parent_following_work_package1 => [Time.zone.today + 5.days, Time.zone.today + 8.days] }@@ -582,16 +582,16 @@ RSpec.describe WorkPackages::SetScheduleService doendend- context 'when moving backwards' do+ context "when moving backwards" dobefore dowork_package.due_date = Time.zone.today - 5.daysend- it_behaves_like 'does not reschedule'+ it_behaves_like "does not reschedule"endend- context 'with a single successor having a child' do+ context "with a single successor having a child" dolet(:child_start_date) { follower1_start_date }let(:child_due_date) { follower1_due_date }@@ -602,12 +602,12 @@ RSpec.describe WorkPackages::SetScheduleService dochild_work_package]end- context 'when moving forward' do+ context "when moving forward" dobefore dowork_package.due_date = Time.zone.today + 5.daysend- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [Time.zone.today + 6.days, Time.zone.today + 8.days],child_work_package => [Time.zone.today + 6.days, Time.zone.today + 8.days] }@@ -616,7 +616,7 @@ RSpec.describe WorkPackages::SetScheduleService doendend- context 'with a single successor having two children' do+ context "with a single successor having two children" dolet(:follower1_start_date) { work_package_due_date + 1.day }let(:follower1_due_date) { work_package_due_date + 10.days }let(:child1_start_date) { follower1_start_date }@@ -633,11 +633,11 @@ RSpec.describe WorkPackages::SetScheduleService dochild2_work_package]end- context 'with unchanged dates (e.g. when creating a follows relation) and successor starting 1 day after scheduled' do- it_behaves_like 'does not reschedule'+ context "with unchanged dates (e.g. when creating a follows relation) and successor starting 1 day after scheduled" do+ it_behaves_like "does not reschedule"end- context 'with unchanged dates (e.g. when creating a follows relation) and successor starting 3 days after scheduled' do+ context "with unchanged dates (e.g. when creating a follows relation) and successor starting 3 days after scheduled" dolet(:follower1_start_date) { work_package_due_date + 3.days }let(:follower1_due_date) { follower1_start_date + 10.days }let(:child1_start_date) { follower1_start_date }@@ -645,10 +645,10 @@ RSpec.describe WorkPackages::SetScheduleService dolet(:child2_start_date) { follower1_start_date + 8.days }let(:child2_due_date) { follower1_due_date }- it_behaves_like 'does not reschedule'+ it_behaves_like "does not reschedule"end- context 'with unchanged dates (e.g. when creating a follows relation) and successor\'s first child needs to be rescheduled' do+ context "with unchanged dates (e.g. when creating a follows relation) and successor's first child needs to be rescheduled" dolet(:follower1_start_date) { work_package_due_date - 3.days }let(:follower1_due_date) { work_package_due_date + 10.days }let(:child1_start_date) { follower1_start_date }@@ -657,7 +657,7 @@ RSpec.describe WorkPackages::SetScheduleService dolet(:child2_due_date) { follower1_due_date }# following parent is reduced in length as the children allow to be executed at the same time- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [work_package_due_date + 1.day, follower1_due_date],child1_work_package => [work_package_due_date + 1.day, follower1_start_date + 10.days] }@@ -674,7 +674,7 @@ RSpec.describe WorkPackages::SetScheduleService dolet(:child2_due_date) { follower1_due_date }# following parent is reduced in length and children are rescheduled- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [work_package_due_date + 1.day, follower1_start_date + 21.days],child1_work_package => [work_package_due_date + 1.day, child1_due_date + 9.days],@@ -684,7 +684,7 @@ RSpec.describe WorkPackages::SetScheduleService doendend- context 'with a chain of successors' do+ context "with a chain of successors" dolet(:follower1_start_date) { Time.zone.today + 1.day }let(:follower1_due_date) { Time.zone.today + 3.days }let(:follower2_start_date) { Time.zone.today + 4.days }@@ -698,12 +698,12 @@ RSpec.describe WorkPackages::SetScheduleService dofollowing_work_package3]end- context 'when moving forward' do+ context "when moving forward" dobefore dowork_package.due_date = Time.zone.today + 5.daysend- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [Time.zone.today + 6.days, Time.zone.today + 8.days],following_work_package2 => [Time.zone.today + 9.days, Time.zone.today + 13.days],@@ -712,7 +712,7 @@ RSpec.describe WorkPackages::SetScheduleService doendend- context 'when moving forward with some space between the followers' do+ context "when moving forward with some space between the followers" dolet(:follower1_start_date) { Time.zone.today + 1.day }let(:follower1_due_date) { Time.zone.today + 3.days }let(:follower2_start_date) { Time.zone.today + 7.days }@@ -724,7 +724,7 @@ RSpec.describe WorkPackages::SetScheduleService dowork_package.due_date = Time.zone.today + 5.daysend- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [Time.zone.today + 6.days, Time.zone.today + 8.days],following_work_package2 => [Time.zone.today + 9.days, Time.zone.today + 12.days] }@@ -732,16 +732,16 @@ RSpec.describe WorkPackages::SetScheduleService doendend- context 'when moving backwards' do+ context "when moving backwards" dobefore dowork_package.due_date = Time.zone.today - 5.daysend- it_behaves_like 'does not reschedule'+ it_behaves_like "does not reschedule"endend- context 'with a chain of successors with two paths leading to the same work package in the end' do+ context "with a chain of successors with two paths leading to the same work package in the end" dolet(:follower3_start_date) { Time.zone.today + 4.days }let(:follower3_due_date) { Time.zone.today + 7.days }let(:follower3_lag) { 0 }@@ -766,12 +766,12 @@ RSpec.describe WorkPackages::SetScheduleService dofollowing_work_package4]end- context 'when moving forward' do+ context "when moving forward" dobefore dowork_package.due_date = Time.zone.today + 5.daysend- it_behaves_like 'reschedules' do+ it_behaves_like "reschedules" dolet(:expected) do{ following_work_package1 => [Time.zone.today + 6.days, Time.zone.today + 8.days],following_work_package2 => [Time.zone.today + 9.days, Time.zone.today + 13.days],@@ -781,16 +781,16 @@ RSpec.describe WorkPackages::SetScheduleService doendend- context 'when moving backwards' do+ context "when moving backwards" dobefore dowork_package.due_date = Time.zone.today - 5.daysend- it_behaves_like 'does not reschedule'+ it_behaves_like "does not reschedule"endend- context 'when setting the parent' do+ context "when setting the parent" dolet(:new_parent_work_package) { create(:work_package) }let(:attributes) { [:parent] }@@ -806,14 +806,14 @@ RSpec.describe WorkPackages::SetScheduleService docontext "with the parent being restricted in its ability to be moved" dolet(:soonest_date) { Time.zone.today + 3.days }- it 'sets the start date and due date to the earliest possible date' do+ it "sets the start date and due date to the earliest possible date" dosubjectexpect(work_package.start_date).to eql(Time.zone.today + 3.days)expect(work_package.due_date).to eql(Time.zone.today + 3.days)end- it 'does not change the due date if after the newly set start date' do+ it "does not change the due date if after the newly set start date" dowork_package.due_date = Time.zone.today + 5.dayssubject@@ -822,7 +822,7 @@ RSpec.describe WorkPackages::SetScheduleService doendend- context 'with the parent being restricted but work package already having dates set' do+ context "with the parent being restricted but work package already having dates set" dolet(:soonest_date) { Time.zone.today + 3.days }before do@@ -830,7 +830,7 @@ RSpec.describe WorkPackages::SetScheduleService dowork_package.due_date = Time.zone.today + 5.daysend- it 'sets the dates to provided dates' do+ it "sets the dates to provided dates" dosubjectexpect(work_package.start_date).to eql(Time.zone.today + 4.days)@@ -838,7 +838,7 @@ RSpec.describe WorkPackages::SetScheduleService doendend- context 'with the parent being restricted but the attributes define an earlier date' do+ context "with the parent being restricted but the attributes define an earlier date" dolet(:soonest_date) { Time.zone.today + 3.days }before do@@ -848,7 +848,7 @@ RSpec.describe WorkPackages::SetScheduleService do# This would be invalid but the dates should be set nevertheless# so we can have a correct error handling.- it 'sets the dates to provided dates' do+ it "sets the dates to provided dates" dosubjectexpect(work_package.start_date).to eql(Time.zone.today + 1.day)@@ -857,7 +857,7 @@ RSpec.describe WorkPackages::SetScheduleService doendend- context 'with deep hierarchy of work packages' do+ context "with deep hierarchy of work packages" dobefore dowork_package.due_date = Time.zone.today - 5.daysend@@ -872,7 +872,7 @@ RSpec.describe WorkPackages::SetScheduleService doendend- it 'does not fail with a SystemStackError (regression #43894)' do+ it "does not fail with a SystemStackError (regression #43894)" doparent = create(:work_package, start_date: Date.current, due_date: Date.current)hierarchy = [1, 1, 1, 1, 2, 4, 4, 4]create_hierarchy(parent, hierarchy)diff --git a/spec/support/components/projects/project_custom_fields/edit_dialog.rb b/spec/support/components/projects/project_custom_fields/edit_dialog.rbindex 0250315b444..80abf886e0a 100644--- a/spec/support/components/projects/project_custom_fields/edit_dialog.rb+++ b/spec/support/components/projects/project_custom_fields/edit_dialog.rb@@ -26,8 +26,8 @@# See COPYRIGHT and LICENSE files for more details.# ++-require 'support/components/common/modal'-require 'support/components/autocompleter/ng_select_autocomplete_helpers'+require "support/components/common/modal"+require "support/components/autocompleter/ng_select_autocomplete_helpers"module Componentsmodule Projects@@ -71,7 +71,7 @@ module Componentsdef close_via_buttonwithin(dialog_css_selector) do- click_link_or_button 'Cancel'+ click_link_or_button "Cancel"endend@@ -96,8 +96,8 @@ module Components###def input_containers- within '#project-section-edit-form > .FormControl-spacingWrapper' do- page.all('.FormControl-spacingWrapper')+ within "#project-section-edit-form > .FormControl-spacingWrapper" do+ page.all(".FormControl-spacingWrapper")endenddiff --git a/spec/support/pages/notifications/center.rb b/spec/support/pages/notifications/center.rbindex 6c0c0d7ac80..f1b5c828341 100644--- a/spec/support/pages/notifications/center.rb+++ b/spec/support/pages/notifications/center.rb@@ -40,7 +40,7 @@ module Pagesenddef mark_all_read- click_button 'Mark all as read'+ click_button "Mark all as read"enddef mark_notification_as_read(notification)@@ -50,13 +50,13 @@ module Pagesenddef show_all- click_button 'All'+ click_button "All"enddef item_title(notification)text = notification.resource.is_a?(WorkPackage) ? notification.resource.subject : notification.subjectwithin_item(notification) do- page.find('span', text:, exact_text: true)+ page.find("span", text:, exact_text: true)endend@@ -111,15 +111,15 @@ module Pagesenddef expect_closed- expect(page).to have_no_css('op-in-app-notification-center')+ expect(page).to have_no_css("op-in-app-notification-center")enddef expect_open- expect(page).to have_css('op-in-app-notification-center')+ expect(page).to have_css("op-in-app-notification-center")enddef expect_empty- expect(page).to have_text 'New notifications will appear here when there is activity that concerns you'+ expect(page).to have_text "New notifications will appear here when there is activity that concerns you"enddef expect_number_of_notifications(count)@@ -143,15 +143,15 @@ module Pagesenddef expect_no_toaster- expect(page).to have_no_css('.op-toast.-info', wait: 10)+ expect(page).to have_no_css(".op-toast.-info", wait: 10)enddef expect_toast- expect(page).to have_css('.op-toast.-info', wait: 10)+ expect(page).to have_css(".op-toast.-info", wait: 10)enddef update_via_toaster- page.find('.op-toast.-info a', wait: 10).click+ page.find(".op-toast.-info a", wait: 10).clickendendend