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

Chore: Use `around` hook to avoid use of instance variable

Aaron Contrerasb119046c6b1d
diff --git a/spec/controllers/account_controller_spec.rb b/spec/controllers/account_controller_spec.rb
index 07728d37e4e..9dd8b3e40f3 100644
--- a/spec/controllers/account_controller_spec.rb
+++ b/spec/controllers/account_controller_spec.rb
@@ -242,13 +242,12 @@ RSpec.describe AccountController,
end
context 'with a relative url root' do
- before do
- @old_relative_url_root = OpenProject::Configuration['rails_relative_url_root']
+ around do |example|
+ old_relative_url_root = OpenProject::Configuration['rails_relative_url_root']
OpenProject::Configuration['rails_relative_url_root'] = '/openproject'
- end
-
- after do
- OpenProject::Configuration['rails_relative_url_root'] = @old_relative_url_root
+ example.run
+ ensure
+ OpenProject::Configuration['rails_relative_url_root'] = old_relative_url_root
end
it 'redirects to the same subdirectory with an absolute path' do