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

Ensure models don't leak between test through RequestStore, for example User.anonymous

Ivan Kuchin36866670ecad
diff --git a/spec/support/rspec_cleanup.rb b/spec/support/rspec_cleanup.rb
index 0028c5f743f..f23f6bf758f 100644
--- a/spec/support/rspec_cleanup.rb
+++ b/spec/support/rspec_cleanup.rb
@@ -16,6 +16,11 @@ RSpec.configure do |config|
RequestStore.clear!
end
+ config.append_after(:all) do
+ # Ensure models don't leak between test through RequestStore if it is used in after(:all)
+ RequestStore.clear!
+ end
+
# We don't want this to be reported on CI as it breaks the build
unless ENV["CI"]
config.append_after(:suite) do