Skip to content

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

use require_relative in specs

Ivan Kuchin2c1d112aea87
diff --git a/modules/auth_saml/spec/lib/open_project/auth_saml_spec.rb b/modules/auth_saml/spec/lib/open_project/auth_saml_spec.rb
index 89b3bdaa3bc..a56bdc32ee8 100644
--- a/modules/auth_saml/spec/lib/open_project/auth_saml_spec.rb
+++ b/modules/auth_saml/spec/lib/open_project/auth_saml_spec.rb
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../spec_helper"
+require_relative "../../spec_helper"
require "open_project/auth_saml"
RSpec.describe OpenProject::AuthSaml do
diff --git a/modules/avatars/spec/controllers/avatars/avatar_controller_spec.rb b/modules/avatars/spec/controllers/avatars/avatar_controller_spec.rb
index 0567ee30f8b..8a26622a897 100644
--- a/modules/avatars/spec/controllers/avatars/avatar_controller_spec.rb
+++ b/modules/avatars/spec/controllers/avatars/avatar_controller_spec.rb
@@ -1,5 +1,5 @@
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
-require File.expand_path(File.dirname(__FILE__) + "/../../shared_examples")
+require_relative "../../spec_helper"
+require_relative "../../shared_examples"
RSpec.describe Avatars::AvatarController do
include_context "there are users with and without avatars"
diff --git a/modules/avatars/spec/controllers/avatars/my_controller_spec.rb b/modules/avatars/spec/controllers/avatars/my_controller_spec.rb
index 8359b7a3049..c76b338a65a 100644
--- a/modules/avatars/spec/controllers/avatars/my_controller_spec.rb
+++ b/modules/avatars/spec/controllers/avatars/my_controller_spec.rb
@@ -1,5 +1,5 @@
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
-require File.expand_path(File.dirname(__FILE__) + "/../../shared_examples")
+require_relative "../../spec_helper"
+require_relative "../../shared_examples"
RSpec.describe Avatars::MyAvatarController do
include_context "there are users with and without avatars"
diff --git a/modules/avatars/spec/controllers/avatars/users_controller_spec.rb b/modules/avatars/spec/controllers/avatars/users_controller_spec.rb
index 065d1f24126..fbbbd7413ba 100644
--- a/modules/avatars/spec/controllers/avatars/users_controller_spec.rb
+++ b/modules/avatars/spec/controllers/avatars/users_controller_spec.rb
@@ -1,5 +1,5 @@
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
-require File.expand_path(File.dirname(__FILE__) + "/../../shared_examples")
+require_relative "../../spec_helper"
+require_relative "../../shared_examples"
RSpec.describe Avatars::UsersController do
include_context "there are users with and without avatars"
diff --git a/modules/avatars/spec/models/user_spec.rb b/modules/avatars/spec/models/user_spec.rb
index 496aab42167..f152e814578 100644
--- a/modules/avatars/spec/models/user_spec.rb
+++ b/modules/avatars/spec/models/user_spec.rb
@@ -1,5 +1,5 @@
-require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
-require File.expand_path("#{File.dirname(__FILE__)}/../shared_examples")
+require_relative "../spec_helper"
+require_relative "../shared_examples"
RSpec.describe User do
let(:user) { build(:user) }
diff --git a/modules/avatars/spec/services/avatars/update_service_spec.rb b/modules/avatars/spec/services/avatars/update_service_spec.rb
index 9f270955b5d..2ed1044d48a 100644
--- a/modules/avatars/spec/services/avatars/update_service_spec.rb
+++ b/modules/avatars/spec/services/avatars/update_service_spec.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
+require_relative "../../spec_helper"
RSpec.describe Avatars::UpdateService do
let(:user_without_avatar) { build_stubbed(:user) }
diff --git a/modules/bim/spec/lib/api/v3/work_packages/eager_loading/cache_checksum_integration_spec.rb b/modules/bim/spec/lib/api/v3/work_packages/eager_loading/cache_checksum_integration_spec.rb
index a35eb243cd1..370933d394e 100644
--- a/modules/bim/spec/lib/api/v3/work_packages/eager_loading/cache_checksum_integration_spec.rb
+++ b/modules/bim/spec/lib/api/v3/work_packages/eager_loading/cache_checksum_integration_spec.rb
@@ -24,7 +24,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
-#++require 'rspec'
+#++
require "spec_helper"
require Rails.root + "spec/lib/api/v3/work_packages/eager_loading/eager_loading_mock_wrapper"
diff --git a/modules/budgets/spec/features/budgets/add_budget_spec.rb b/modules/budgets/spec/features/budgets/add_budget_spec.rb
index 683cd8c45ac..e3d91121954 100644
--- a/modules/budgets/spec/features/budgets/add_budget_spec.rb
+++ b/modules/budgets/spec/features/budgets/add_budget_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper"
RSpec.describe "adding a new budget", :js do
let(:project) { create(:project_with_types, members: project_members) }
diff --git a/modules/budgets/spec/features/budgets/copy_budget_spec.rb b/modules/budgets/spec/features/budgets/copy_budget_spec.rb
index 44022d90ad7..b7c30162434 100644
--- a/modules/budgets/spec/features/budgets/copy_budget_spec.rb
+++ b/modules/budgets/spec/features/budgets/copy_budget_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper"
RSpec.describe "Copying a budget", :js do
let(:project) { create(:project, enabled_module_names: %i[budgets costs]) }
diff --git a/modules/budgets/spec/features/budgets/delete_budget_spec.rb b/modules/budgets/spec/features/budgets/delete_budget_spec.rb
index 81688f9398c..61bb0ab7d28 100644
--- a/modules/budgets/spec/features/budgets/delete_budget_spec.rb
+++ b/modules/budgets/spec/features/budgets/delete_budget_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper.rb")
+require_relative "../../spec_helper"
RSpec.describe "Deleting a budget", :js do
let(:project) { create(:project, enabled_module_names: %i[budgets costs]) }
diff --git a/modules/budgets/spec/features/budgets/update_budget_spec.rb b/modules/budgets/spec/features/budgets/update_budget_spec.rb
index 2e29d07e183..6d44d77c3b7 100644
--- a/modules/budgets/spec/features/budgets/update_budget_spec.rb
+++ b/modules/budgets/spec/features/budgets/update_budget_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper.rb")
+require_relative "../../spec_helper"
RSpec.describe "updating a budget", :js, :selenium do
let(:project) do
diff --git a/modules/budgets/spec/features/costs_edit_fields_spec.rb b/modules/budgets/spec/features/costs_edit_fields_spec.rb
index ff219e26c99..83f16510888 100644
--- a/modules/budgets/spec/features/costs_edit_fields_spec.rb
+++ b/modules/budgets/spec/features/costs_edit_fields_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
+require_relative "../spec_helper"
RSpec.describe "Work Package budget fields",
:js,
diff --git a/modules/budgets/spec/helpers/budgets_helper_spec.rb b/modules/budgets/spec/helpers/budgets_helper_spec.rb
index 78fe4e90a1b..adce56c8c4c 100644
--- a/modules/budgets/spec/helpers/budgets_helper_spec.rb
+++ b/modules/budgets/spec/helpers/budgets_helper_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.dirname(__FILE__) + "/../spec_helper"
+require_relative "../spec_helper"
RSpec.describe BudgetsHelper do
let(:project) { build(:project) }
diff --git a/modules/budgets/spec/models/budget_spec.rb b/modules/budgets/spec/models/budget_spec.rb
index bc5bc8483a0..7857635df56 100644
--- a/modules/budgets/spec/models/budget_spec.rb
+++ b/modules/budgets/spec/models/budget_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.dirname(__FILE__) + "/../spec_helper"
+require_relative "../spec_helper"
RSpec.describe Budget do
let(:budget) { build(:budget, project:) }
diff --git a/modules/budgets/spec/models/labor_budget_item_spec.rb b/modules/budgets/spec/models/labor_budget_item_spec.rb
index 7160270c685..e0262b59bc1 100644
--- a/modules/budgets/spec/models/labor_budget_item_spec.rb
+++ b/modules/budgets/spec/models/labor_budget_item_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.dirname(__FILE__) + "/../spec_helper"
+require_relative "../spec_helper"
RSpec.describe LaborBudgetItem do
let(:item) { build(:labor_budget_item, budget:, user:) }
diff --git a/modules/costs/spec/controllers/admin/cost_types_controller_spec.rb b/modules/costs/spec/controllers/admin/cost_types_controller_spec.rb
index 236cc99e2d0..95311b9cb7d 100644
--- a/modules/costs/spec/controllers/admin/cost_types_controller_spec.rb
+++ b/modules/costs/spec/controllers/admin/cost_types_controller_spec.rb
@@ -28,7 +28,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper.rb")
+require_relative "../../spec_helper"
RSpec.describe Admin::CostTypesController do
let(:admin) { create(:admin) }
diff --git a/modules/costs/spec/controllers/costlog_controller_spec.rb b/modules/costs/spec/controllers/costlog_controller_spec.rb
index b3f78082d94..8574cd8d92a 100644
--- a/modules/costs/spec/controllers/costlog_controller_spec.rb
+++ b/modules/costs/spec/controllers/costlog_controller_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
+require_relative "../spec_helper"
RSpec.describe CostlogController do
include Cost::PluginSpecHelper
diff --git a/modules/costs/spec/controllers/hourly_rates_controller_spec.rb b/modules/costs/spec/controllers/hourly_rates_controller_spec.rb
index 839536e230c..f5ce4ecb4e0 100644
--- a/modules/costs/spec/controllers/hourly_rates_controller_spec.rb
+++ b/modules/costs/spec/controllers/hourly_rates_controller_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
+require_relative "../spec_helper"
RSpec.describe HourlyRatesController do
shared_let(:admin) { create(:admin) }
diff --git a/modules/costs/spec/controllers/time_entries_controller_spec.rb b/modules/costs/spec/controllers/time_entries_controller_spec.rb
index 7b426c08626..82000dd27b0 100644
--- a/modules/costs/spec/controllers/time_entries_controller_spec.rb
+++ b/modules/costs/spec/controllers/time_entries_controller_spec.rb
@@ -28,7 +28,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper.rb")
+require_relative "../spec_helper"
RSpec.describe TimeEntriesController do
include Redmine::I18n
diff --git a/modules/costs/spec/features/destroy_work_package_with_cost_entries_spec.rb b/modules/costs/spec/features/destroy_work_package_with_cost_entries_spec.rb
index 8f4ec4eeb2c..9ac74610d0b 100644
--- a/modules/costs/spec/features/destroy_work_package_with_cost_entries_spec.rb
+++ b/modules/costs/spec/features/destroy_work_package_with_cost_entries_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
+require_relative "../spec_helper"
RSpec.describe "Deleting time entries", :js do
let(:project) { work_package.project }
diff --git a/modules/costs/spec/features/members_hourly_rates_spec.rb b/modules/costs/spec/features/members_hourly_rates_spec.rb
index 485bc20e58f..d7e650ad984 100644
--- a/modules/costs/spec/features/members_hourly_rates_spec.rb
+++ b/modules/costs/spec/features/members_hourly_rates_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
+require_relative "../spec_helper"
RSpec.describe "hourly rates on a member", :js do
let(:project) { build(:project) }
diff --git a/modules/costs/spec/features/time_entry_dialog_spec.rb b/modules/costs/spec/features/time_entry_dialog_spec.rb
index e33b8ab21ff..a295e01bb6c 100644
--- a/modules/costs/spec/features/time_entry_dialog_spec.rb
+++ b/modules/costs/spec/features/time_entry_dialog_spec.rb
@@ -28,7 +28,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper.rb")
+require_relative "../spec_helper"
RSpec.describe "time entry dialog", :js, with_flag: :track_start_and_end_times_for_time_entries do
include Redmine::I18n
diff --git a/modules/costs/spec/features/view_own_rates_spec.rb b/modules/costs/spec/features/view_own_rates_spec.rb
index 5387e8928ef..cf5b3988212 100644
--- a/modules/costs/spec/features/view_own_rates_spec.rb
+++ b/modules/costs/spec/features/view_own_rates_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
+require_relative "../spec_helper"
RSpec.describe "Only see your own rates", :js do
let(:project) { work_package.project }
diff --git a/modules/costs/spec/helpers/costs/number_helper_spec.rb b/modules/costs/spec/helpers/costs/number_helper_spec.rb
index 4e6944bd6f6..042d9356d81 100644
--- a/modules/costs/spec/helpers/costs/number_helper_spec.rb
+++ b/modules/costs/spec/helpers/costs/number_helper_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.dirname(__FILE__) + "/../../spec_helper"
+require_relative "../../spec_helper"
RSpec.describe Costs::NumberHelper do
describe "#parse_number_string" do
diff --git a/modules/costs/spec/models/cost_entry_spec.rb b/modules/costs/spec/models/cost_entry_spec.rb
index eaaeda1d902..c3879a169c4 100644
--- a/modules/costs/spec/models/cost_entry_spec.rb
+++ b/modules/costs/spec/models/cost_entry_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
+require_relative "../spec_helper"
RSpec.describe CostEntry do
include Cost::PluginSpecHelper
diff --git a/modules/costs/spec/models/cost_type_spec.rb b/modules/costs/spec/models/cost_type_spec.rb
index e5694f68bcc..2c3b2e5879e 100644
--- a/modules/costs/spec/models/cost_type_spec.rb
+++ b/modules/costs/spec/models/cost_type_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
+require_relative "../spec_helper"
RSpec.describe CostType do
let(:klass) { CostType }
diff --git a/modules/costs/spec/models/default_hourly_rate_spec.rb b/modules/costs/spec/models/default_hourly_rate_spec.rb
index b3222985098..1f3950092a1 100644
--- a/modules/costs/spec/models/default_hourly_rate_spec.rb
+++ b/modules/costs/spec/models/default_hourly_rate_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.dirname(__FILE__) + "/../spec_helper"
+require_relative "../spec_helper"
RSpec.describe DefaultHourlyRate do
let(:project) { create(:project) }
diff --git a/modules/costs/spec/models/hourly_rate_spec.rb b/modules/costs/spec/models/hourly_rate_spec.rb
index ea4b43ef1cf..cdd5de15049 100644
--- a/modules/costs/spec/models/hourly_rate_spec.rb
+++ b/modules/costs/spec/models/hourly_rate_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.dirname(__FILE__) + "/../spec_helper"
+require_relative "../spec_helper"
RSpec.describe HourlyRate do
let(:project) { create(:project) }
diff --git a/modules/costs/spec/models/permitted_params_spec.rb b/modules/costs/spec/models/permitted_params_spec.rb
index 5b9608f80a5..775b63ef843 100644
--- a/modules/costs/spec/models/permitted_params_spec.rb
+++ b/modules/costs/spec/models/permitted_params_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("../spec_helper", __dir__)
+require_relative "../spec_helper"
RSpec.describe PermittedParams do
let(:user) { build(:user) }
diff --git a/modules/costs/spec/models/rate_spec.rb b/modules/costs/spec/models/rate_spec.rb
index 8d231ddcd62..b7408bb6b0a 100644
--- a/modules/costs/spec/models/rate_spec.rb
+++ b/modules/costs/spec/models/rate_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.dirname(__FILE__) + "/../spec_helper"
+require_relative "../spec_helper"
RSpec.describe Rate do
let(:rate) { build(:rate) }
diff --git a/modules/costs/spec/models/user_spec.rb b/modules/costs/spec/models/user_spec.rb
index 3f27d133511..048999913bc 100644
--- a/modules/costs/spec/models/user_spec.rb
+++ b/modules/costs/spec/models/user_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.dirname(__FILE__) + "/../spec_helper"
+require_relative "../spec_helper"
RSpec.describe User do
include Cost::PluginSpecHelper
diff --git a/modules/costs/spec/models/work_package_spec.rb b/modules/costs/spec/models/work_package_spec.rb
index cfd7e7836a9..a61f2574a7e 100644
--- a/modules/costs/spec/models/work_package_spec.rb
+++ b/modules/costs/spec/models/work_package_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
+require_relative "../spec_helper"
RSpec.describe WorkPackage do
let(:user) { create(:admin) }
diff --git a/modules/costs/spec/spec_helper.rb b/modules/costs/spec/spec_helper.rb
index 64a1cc1ebeb..7e50d2d9851 100644
--- a/modules/costs/spec/spec_helper.rb
+++ b/modules/costs/spec/spec_helper.rb
@@ -29,6 +29,6 @@
# -- load spec_helper from OpenProject core
require "spec_helper"
-require File.join(File.dirname(__FILE__), "plugin_spec_helper")
+require_relative "plugin_spec_helper"
Dir[File.join(File.dirname(__FILE__), "support/**/*.rb")].sort.each { |f| require f }
diff --git a/modules/documents/spec/lib/redmine/access_control_spec.rb b/modules/documents/spec/lib/redmine/access_control_spec.rb
index 04cb7293553..890e1738018 100644
--- a/modules/documents/spec/lib/redmine/access_control_spec.rb
+++ b/modules/documents/spec/lib/redmine/access_control_spec.rb
@@ -25,7 +25,7 @@
#
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.dirname(__FILE__) + "/../../spec_helper"
+require_relative "../../spec_helper"
RSpec.describe OpenProject::AccessControl do
describe "manage documents permission" do
diff --git a/modules/documents/spec/mailers/documents_mailer_spec.rb b/modules/documents/spec/mailers/documents_mailer_spec.rb
index 20c506f4a4f..10763017715 100644
--- a/modules/documents/spec/mailers/documents_mailer_spec.rb
+++ b/modules/documents/spec/mailers/documents_mailer_spec.rb
@@ -25,7 +25,7 @@
#
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.dirname(__FILE__) + "/../spec_helper"
+require_relative "../spec_helper"
RSpec.describe DocumentsMailer do
let(:user) do
diff --git a/modules/documents/spec/models/document_category_spec.rb b/modules/documents/spec/models/document_category_spec.rb
index 2473187c1b6..a1a393ce43a 100644
--- a/modules/documents/spec/models/document_category_spec.rb
+++ b/modules/documents/spec/models/document_category_spec.rb
@@ -25,7 +25,7 @@
#
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.dirname(__FILE__) + "/../spec_helper"
+require_relative "../spec_helper"
RSpec.describe DocumentCategory do
let(:project) { create(:project) }
diff --git a/modules/documents/spec/models/document_spec.rb b/modules/documents/spec/models/document_spec.rb
index 0aa594e09c8..d09dbb446b2 100644
--- a/modules/documents/spec/models/document_spec.rb
+++ b/modules/documents/spec/models/document_spec.rb
@@ -25,7 +25,7 @@
#
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.dirname(__FILE__) + "/../spec_helper"
+require_relative "../spec_helper"
RSpec.describe Document do
let(:documentation_category) { create(:document_category, name: "User documentation") }
diff --git a/modules/github_integration/spec/lib/open_project/github_integration/hook_handler_integration_spec.rb b/modules/github_integration/spec/lib/open_project/github_integration/hook_handler_integration_spec.rb
index 6cd37c5c784..a4d9a2f11eb 100644
--- a/modules/github_integration/spec/lib/open_project/github_integration/hook_handler_integration_spec.rb
+++ b/modules/github_integration/spec/lib/open_project/github_integration/hook_handler_integration_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("../../../spec_helper", __dir__)
+require_relative "../../../spec_helper"
RSpec.describe OpenProject::GithubIntegration::HookHandler do
subject(:process_webhook) do
diff --git a/modules/github_integration/spec/lib/open_project/github_integration/hook_handler_spec.rb b/modules/github_integration/spec/lib/open_project/github_integration/hook_handler_spec.rb
index 3f1242fbfcc..8889254f6da 100644
--- a/modules/github_integration/spec/lib/open_project/github_integration/hook_handler_spec.rb
+++ b/modules/github_integration/spec/lib/open_project/github_integration/hook_handler_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("../../../spec_helper", __dir__)
+require_relative "../../../spec_helper"
RSpec.describe OpenProject::GithubIntegration::HookHandler do
describe "#process" do
diff --git a/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/check_run_spec.rb b/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/check_run_spec.rb
index 87f4efe6dd6..f12ed0e628f 100644
--- a/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/check_run_spec.rb
+++ b/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/check_run_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("../../../../spec_helper", __dir__)
+require_relative "../../../../spec_helper"
RSpec.describe OpenProject::GithubIntegration::NotificationHandler::CheckRun do
subject(:process) { described_class.new.process(payload) }
diff --git a/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/helper_spec.rb b/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/helper_spec.rb
index 067d0ec4d3c..04d0d357ae7 100644
--- a/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/helper_spec.rb
+++ b/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/helper_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("../../../../spec_helper", __dir__)
+require_relative "../../../../spec_helper"
RSpec.describe OpenProject::GithubIntegration::NotificationHandler::Helper do
subject(:handler) { Class.new.include(described_class).new }
diff --git a/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/issue_comment_spec.rb b/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/issue_comment_spec.rb
index 4f8f94da245..59fc4b4b9c1 100644
--- a/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/issue_comment_spec.rb
+++ b/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/issue_comment_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("../../../../spec_helper", __dir__)
+require_relative "../../../../spec_helper"
RSpec.describe OpenProject::GithubIntegration::NotificationHandler::IssueComment do
subject(:process) { handler_instance.process(payload) }
diff --git a/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/pull_request_spec.rb b/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/pull_request_spec.rb
index 4c505241820..3ad6e46e471 100644
--- a/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/pull_request_spec.rb
+++ b/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/pull_request_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("../../../../spec_helper", __dir__)
+require_relative "../../../../spec_helper"
RSpec.describe OpenProject::GithubIntegration::NotificationHandler::PullRequest do
subject(:process) { handler_instance.process(payload) }
diff --git a/modules/github_integration/spec/lib/open_project/github_integration/notification_handler_spec.rb b/modules/github_integration/spec/lib/open_project/github_integration/notification_handler_spec.rb
index 7bd7e649189..c6def3ec15f 100644
--- a/modules/github_integration/spec/lib/open_project/github_integration/notification_handler_spec.rb
+++ b/modules/github_integration/spec/lib/open_project/github_integration/notification_handler_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("../../../spec_helper", __dir__)
+require_relative "../../../spec_helper"
RSpec.describe OpenProject::GithubIntegration::NotificationHandler do
let(:payload) { {} }
diff --git a/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_check_run_spec.rb b/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_check_run_spec.rb
index 5cd2863b110..330ba8bf56e 100644
--- a/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_check_run_spec.rb
+++ b/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_check_run_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("../../../../spec_helper", __dir__)
+require_relative "../../../../spec_helper"
RSpec.describe OpenProject::GithubIntegration::Services::UpsertCheckRun do
subject(:upsert) { described_class.new.call(params, pull_request: github_pull_request) }
diff --git a/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_github_user_spec.rb b/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_github_user_spec.rb
index 84ab3b25953..3f8369d3902 100644
--- a/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_github_user_spec.rb
+++ b/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_github_user_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("../../../../spec_helper", __dir__)
+require_relative "../../../../spec_helper"
RSpec.describe OpenProject::GithubIntegration::Services::UpsertGithubUser do
subject(:upsert) { described_class.new.call(params) }
diff --git a/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_partial_pull_request_spec.rb b/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_partial_pull_request_spec.rb
index b93a18445ad..cbab6484574 100644
--- a/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_partial_pull_request_spec.rb
+++ b/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_partial_pull_request_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("../../../../spec_helper", __dir__)
+require_relative "../../../../spec_helper"
RSpec.describe OpenProject::GithubIntegration::Services::UpsertPartialPullRequest do
subject(:upsert) do
diff --git a/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_pull_request_spec.rb b/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_pull_request_spec.rb
index b5ba385f467..48772f88214 100644
--- a/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_pull_request_spec.rb
+++ b/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_pull_request_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("../../../../spec_helper", __dir__)
+require_relative "../../../../spec_helper"
RSpec.describe OpenProject::GithubIntegration::Services::UpsertPullRequest do
subject(:upsert) { described_class.new.call(params, work_packages:) }
diff --git a/modules/ldap_groups/spec/services/synchronization_spec.rb b/modules/ldap_groups/spec/services/synchronization_spec.rb
index fcbca7507ba..bcb73485268 100644
--- a/modules/ldap_groups/spec/services/synchronization_spec.rb
+++ b/modules/ldap_groups/spec/services/synchronization_spec.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + "/../spec_helper"
+require_relative "../spec_helper"
require "ladle"
RSpec.describe LdapGroups::SynchronizeGroupsService, with_ee: %i[ldap_groups] do
diff --git a/modules/ldap_groups/spec/services/synchronize_filter_spec.rb b/modules/ldap_groups/spec/services/synchronize_filter_spec.rb
index c6c0c9ae2ad..c1b94ba0860 100644
--- a/modules/ldap_groups/spec/services/synchronize_filter_spec.rb
+++ b/modules/ldap_groups/spec/services/synchronize_filter_spec.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + "/../spec_helper"
+require_relative "../spec_helper"
require "ladle"
RSpec.describe LdapGroups::SynchronizeFilterService, with_ee: %i[ldap_groups] do
diff --git a/modules/meeting/spec/models/meeting_agenda_spec.rb b/modules/meeting/spec/models/meeting_agenda_spec.rb
index 4456bc59cae..becc0486d6b 100644
--- a/modules/meeting/spec/models/meeting_agenda_spec.rb
+++ b/modules/meeting/spec/models/meeting_agenda_spec.rb
@@ -27,7 +27,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.dirname(__FILE__) + "/../spec_helper"
+require_relative "../spec_helper"
RSpec.describe "MeetingAgenda" do
before do
diff --git a/modules/meeting/spec/models/meeting_minutes_spec.rb b/modules/meeting/spec/models/meeting_minutes_spec.rb
index 953503e9ce7..500657d1bf8 100644
--- a/modules/meeting/spec/models/meeting_minutes_spec.rb
+++ b/modules/meeting/spec/models/meeting_minutes_spec.rb
@@ -27,7 +27,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.dirname(__FILE__) + "/../spec_helper"
+require_relative "../spec_helper"
RSpec.describe "MeetingMinutes" do
before do
diff --git a/modules/meeting/spec/models/meeting_spec.rb b/modules/meeting/spec/models/meeting_spec.rb
index f8fc94b7124..8e45a28c4eb 100644
--- a/modules/meeting/spec/models/meeting_spec.rb
+++ b/modules/meeting/spec/models/meeting_spec.rb
@@ -27,7 +27,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.dirname(__FILE__) + "/../spec_helper"
+require_relative "../spec_helper"
RSpec.describe Meeting do
shared_let (:user1) { create(:user) }
diff --git a/modules/meeting/spec/models/permitted_params_spec.rb b/modules/meeting/spec/models/permitted_params_spec.rb
index 038354950b3..a6041fee707 100644
--- a/modules/meeting/spec/models/permitted_params_spec.rb
+++ b/modules/meeting/spec/models/permitted_params_spec.rb
@@ -27,7 +27,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.dirname(__FILE__) + "/../spec_helper"
+require_relative "../spec_helper"
RSpec.describe PermittedParams do
let(:user) { build_stubbed(:user) }
diff --git a/modules/reporting/spec/controllers/cost_reports_controller_spec.rb b/modules/reporting/spec/controllers/cost_reports_controller_spec.rb
index c8a02d04c3e..be2aa7aa496 100644
--- a/modules/reporting/spec/controllers/cost_reports_controller_spec.rb
+++ b/modules/reporting/spec/controllers/cost_reports_controller_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
+require_relative "../spec_helper"
RSpec.describe CostReportsController do
include OpenProject::Reporting::PluginSpecHelper
diff --git a/modules/reporting/spec/features/update_cost_report_spec.rb b/modules/reporting/spec/features/update_cost_report_spec.rb
index 0ffbdd669cc..6aff880082c 100644
--- a/modules/reporting/spec/features/update_cost_report_spec.rb
+++ b/modules/reporting/spec/features/update_cost_report_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb")
+require_relative "../spec_helper"
require_relative "support/pages/cost_report_page"
RSpec.describe "updating a cost report's cost type", :js, :selenium do
diff --git a/modules/reporting/spec/models/cost_query/cache_spec.rb b/modules/reporting/spec/models/cost_query/cache_spec.rb
index c98e33cccc3..352bd86f95a 100644
--- a/modules/reporting/spec/models/cost_query/cache_spec.rb
+++ b/modules/reporting/spec/models/cost_query/cache_spec.rb
@@ -27,7 +27,7 @@
#++
require "spec_helper"
-require File.join(File.dirname(__FILE__), "..", "..", "support", "configuration_helper")
+require_relative "../../support/configuration_helper"
RSpec.describe CostQuery::Cache do
include OpenProject::Reporting::SpecHelper::ConfigurationHelper
diff --git a/modules/reporting/spec/models/cost_query/chaining_spec.rb b/modules/reporting/spec/models/cost_query/chaining_spec.rb
index a12e62861e5..f8d7a1d65f6 100644
--- a/modules/reporting/spec/models/cost_query/chaining_spec.rb
+++ b/modules/reporting/spec/models/cost_query/chaining_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper")
+require_relative "../../spec_helper"
RSpec.describe CostQuery, :reporting_query_helper do
let(:project) { create(:project) }
diff --git a/modules/reporting/spec/models/cost_query/filter_spec.rb b/modules/reporting/spec/models/cost_query/filter_spec.rb
index c1a1ef3f31e..89bf1b83300 100644
--- a/modules/reporting/spec/models/cost_query/filter_spec.rb
+++ b/modules/reporting/spec/models/cost_query/filter_spec.rb
@@ -26,8 +26,8 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper")
-require File.join(File.dirname(__FILE__), "..", "..", "support", "custom_field_filter")
+require_relative "../../spec_helper"
+require_relative "../../support/custom_field_filter"
RSpec.describe CostQuery, :reporting_query_helper do
minimal_query
diff --git a/modules/reporting/spec/models/cost_query/group_by_spec.rb b/modules/reporting/spec/models/cost_query/group_by_spec.rb
index 37a8ea741a5..b7803c7e55e 100644
--- a/modules/reporting/spec/models/cost_query/group_by_spec.rb
+++ b/modules/reporting/spec/models/cost_query/group_by_spec.rb
@@ -26,8 +26,8 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper")
-require File.join(File.dirname(__FILE__), "..", "..", "support", "custom_field_filter")
+require_relative "../../spec_helper"
+require_relative "../../support/custom_field_filter"
RSpec.describe CostQuery, :reporting_query_helper do
let!(:type) { create(:type) }
diff --git a/modules/reporting/spec/models/cost_query/integration_spec.rb b/modules/reporting/spec/models/cost_query/integration_spec.rb
index 2c94cef19d4..17d4f5978ab 100644
--- a/modules/reporting/spec/models/cost_query/integration_spec.rb
+++ b/modules/reporting/spec/models/cost_query/integration_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper")
+require_relative "../../spec_helper"
RSpec.describe CostQuery, :reporting_query_helper do
minimal_query
diff --git a/modules/reporting/spec/models/cost_query/operator_spec.rb b/modules/reporting/spec/models/cost_query/operator_spec.rb
index 3d440f96988..1cc232352ed 100644
--- a/modules/reporting/spec/models/cost_query/operator_spec.rb
+++ b/modules/reporting/spec/models/cost_query/operator_spec.rb
@@ -28,7 +28,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper")
+require_relative "../../spec_helper"
RSpec.describe CostQuery::Operator, :reporting_query_helper do
minimal_query
diff --git a/modules/reporting/spec/models/cost_query/result_spec.rb b/modules/reporting/spec/models/cost_query/result_spec.rb
index 48e95fd6434..bd1c3c4b612 100644
--- a/modules/reporting/spec/models/cost_query/result_spec.rb
+++ b/modules/reporting/spec/models/cost_query/result_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper")
+require_relative "../../spec_helper"
RSpec.describe CostQuery, :reporting_query_helper do
before do
diff --git a/modules/reporting/spec/models/cost_query/validation_spec.rb b/modules/reporting/spec/models/cost_query/validation_spec.rb
index 0192d2e8896..186e56f8a41 100644
--- a/modules/reporting/spec/models/cost_query/validation_spec.rb
+++ b/modules/reporting/spec/models/cost_query/validation_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
+require_relative "../../spec_helper"
RSpec.describe "CostQuery::Validation" do
class CostQuery::SomeBase
diff --git a/modules/reporting/spec/models/cost_query/walker_spec.rb b/modules/reporting/spec/models/cost_query/walker_spec.rb
index e77f979ddbe..2b43861433a 100644
--- a/modules/reporting/spec/models/cost_query/walker_spec.rb
+++ b/modules/reporting/spec/models/cost_query/walker_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper")
+require_relative "../../spec_helper"
RSpec.describe CostQuery, :reporting_query_helper do
minimal_query
diff --git a/modules/reporting/spec/requests/custom_field_cache_spec.rb b/modules/reporting/spec/requests/custom_field_cache_spec.rb
index 85103fa5465..e92b5c5b6e2 100644
--- a/modules/reporting/spec/requests/custom_field_cache_spec.rb
+++ b/modules/reporting/spec/requests/custom_field_cache_spec.rb
@@ -27,8 +27,8 @@
#++
require "spec_helper"
-require File.join(File.dirname(__FILE__), "..", "support", "custom_field_filter")
-require File.join(File.dirname(__FILE__), "..", "support", "configuration_helper")
+require_relative "../support/custom_field_filter"
+require_relative "../support/configuration_helper"
RSpec.describe "Custom field filter and group by caching" do
include OpenProject::Reporting::SpecHelper::CustomFieldFilterHelper
diff --git a/modules/two_factor_authentication/spec/services/token_delivery/message_bird_spec.rb b/modules/two_factor_authentication/spec/services/token_delivery/message_bird_spec.rb
index 7ef6394e0aa..8946549e8f6 100644
--- a/modules/two_factor_authentication/spec/services/token_delivery/message_bird_spec.rb
+++ b/modules/two_factor_authentication/spec/services/token_delivery/message_bird_spec.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
+require_relative "../../spec_helper"
require "messagebird"
RSpec.describe OpenProject::TwoFactorAuthentication::TokenStrategy::MessageBird do
diff --git a/modules/two_factor_authentication/spec/services/token_delivery/sns_spec.rb b/modules/two_factor_authentication/spec/services/token_delivery/sns_spec.rb
index 9c2a538555e..067a31aad70 100644
--- a/modules/two_factor_authentication/spec/services/token_delivery/sns_spec.rb
+++ b/modules/two_factor_authentication/spec/services/token_delivery/sns_spec.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
+require_relative "../../spec_helper"
RSpec.describe OpenProject::TwoFactorAuthentication::TokenStrategy::Sns do
describe "sending messages" do
diff --git a/modules/two_factor_authentication/spec/services/token_delivery/totp_spec.rb b/modules/two_factor_authentication/spec/services/token_delivery/totp_spec.rb
index ca6e598524a..8936840ba8f 100644
--- a/modules/two_factor_authentication/spec/services/token_delivery/totp_spec.rb
+++ b/modules/two_factor_authentication/spec/services/token_delivery/totp_spec.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
+require_relative "../../spec_helper"
RSpec.describe OpenProject::TwoFactorAuthentication::TokenStrategy::Totp do
describe "sending messages" do
diff --git a/modules/webhooks/spec/controllers/webhooks_controller_spec.rb b/modules/webhooks/spec/controllers/webhooks_controller_spec.rb
index bef2e3f8bb6..bc1c6649995 100644
--- a/modules/webhooks/spec/controllers/webhooks_controller_spec.rb
+++ b/modules/webhooks/spec/controllers/webhooks_controller_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("../spec_helper", __dir__)
+require_relative "../spec_helper"
RSpec.describe Webhooks::Incoming::HooksController do
let(:hook) { double(OpenProject::Webhooks::Hook) }
diff --git a/modules/webhooks/spec/lib/hook_spec.rb b/modules/webhooks/spec/lib/hook_spec.rb
index 9921fd197dc..a642037f62c 100644
--- a/modules/webhooks/spec/lib/hook_spec.rb
+++ b/modules/webhooks/spec/lib/hook_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("../spec_helper", __dir__)
+require_relative "../spec_helper"
RSpec.describe OpenProject::Webhooks::Hook do
describe "#relative_url" do
diff --git a/modules/webhooks/spec/lib/webhooks_spec.rb b/modules/webhooks/spec/lib/webhooks_spec.rb
index d897ee2a851..5aa06e03cfa 100644
--- a/modules/webhooks/spec/lib/webhooks_spec.rb
+++ b/modules/webhooks/spec/lib/webhooks_spec.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("../spec_helper", __dir__)
+require_relative "../spec_helper"
RSpec.describe OpenProject::Webhooks do
describe ".register_hook" do
diff --git a/spec/lib/api/v3/work_packages/create_form_representer_spec.rb b/spec/lib/api/v3/work_packages/create_form_representer_spec.rb
index 2b7fc12e7fa..93da3ebf084 100644
--- a/spec/lib/api/v3/work_packages/create_form_representer_spec.rb
+++ b/spec/lib/api/v3/work_packages/create_form_representer_spec.rb
@@ -24,7 +24,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
-#++require 'rspec'
+#++
require "spec_helper"
diff --git a/spec/lib/api/v3/work_packages/create_project_form_representer_spec.rb b/spec/lib/api/v3/work_packages/create_project_form_representer_spec.rb
index 91a11cfdd55..0de72e9e996 100644
--- a/spec/lib/api/v3/work_packages/create_project_form_representer_spec.rb
+++ b/spec/lib/api/v3/work_packages/create_project_form_representer_spec.rb
@@ -24,7 +24,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
-#++require 'rspec'
+#++
require "spec_helper"
diff --git a/spec/lib/api/v3/work_packages/eager_loading/cache_checksum_integration_spec.rb b/spec/lib/api/v3/work_packages/eager_loading/cache_checksum_integration_spec.rb
index 133f45e8a47..2635d11200b 100644
--- a/spec/lib/api/v3/work_packages/eager_loading/cache_checksum_integration_spec.rb
+++ b/spec/lib/api/v3/work_packages/eager_loading/cache_checksum_integration_spec.rb
@@ -24,7 +24,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
-#++require 'rspec'
+#++
require "spec_helper"
require_relative "eager_loading_mock_wrapper"
diff --git a/spec/lib/api/v3/work_packages/eager_loading/custom_actions_integration_spec.rb b/spec/lib/api/v3/work_packages/eager_loading/custom_actions_integration_spec.rb
index b8619e6a0ea..2ecef70b8f6 100644
--- a/spec/lib/api/v3/work_packages/eager_loading/custom_actions_integration_spec.rb
+++ b/spec/lib/api/v3/work_packages/eager_loading/custom_actions_integration_spec.rb
@@ -24,7 +24,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
-#++require 'rspec'
+#++
require "spec_helper"
require_relative "eager_loading_mock_wrapper"
diff --git a/spec/lib/api/v3/work_packages/eager_loading/principals_integration_spec.rb b/spec/lib/api/v3/work_packages/eager_loading/principals_integration_spec.rb
index c1e36e0c449..1ec99158133 100644
--- a/spec/lib/api/v3/work_packages/eager_loading/principals_integration_spec.rb
+++ b/spec/lib/api/v3/work_packages/eager_loading/principals_integration_spec.rb
@@ -24,7 +24,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
-#++require 'rspec'
+#++
require "spec_helper"
require_relative "eager_loading_mock_wrapper"
diff --git a/spec/lib/api/v3/work_packages/eager_loading/project_integration_spec.rb b/spec/lib/api/v3/work_packages/eager_loading/project_integration_spec.rb
index 75848664c03..1b45cbc58fc 100644
--- a/spec/lib/api/v3/work_packages/eager_loading/project_integration_spec.rb
+++ b/spec/lib/api/v3/work_packages/eager_loading/project_integration_spec.rb
@@ -24,7 +24,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
-#++require 'rspec'
+#++
require "spec_helper"
require_relative "eager_loading_mock_wrapper"
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index 4976df30be2..3d6b257c39d 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
ENV["RAILS_ENV"] ||= "test"
-require File.expand_path("../config/environment", __dir__)
+require_relative "../config/environment"
require "factory_bot"
require "factory_bot_rails"
require "rspec/rails"
diff --git a/spec/support/permission_specs.rb b/spec/support/permission_specs.rb
index df53b60061e..fb521dd45ed 100644
--- a/spec/support/permission_specs.rb
+++ b/spec/support/permission_specs.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-require File.expand_path("shared/become_member", __dir__)
+require_relative "shared/become_member"
module PermissionSpecs
def self.included(base)