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

remove only custom_fields related keys from RequestStore after creating custom field using factory

Ivan Kuchin69943f2c6e61
diff --git a/spec/factories/custom_field_factory.rb b/spec/factories/custom_field_factory.rb
index 92b90db4501..eb19a31c60d 100644
--- a/spec/factories/custom_field_factory.rb
+++ b/spec/factories/custom_field_factory.rb
@@ -56,7 +56,7 @@ FactoryBot.define do
after(:create) do
# As the request store keeps track of the created custom fields
- RequestStore.clear!
+ RequestStore.store.delete_if { |key, _| key.to_s.include?("_custom_fields") }
end
trait :multi_value do