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

Fix flickering test

Christophe Bliard52583389de78
diff --git a/modules/reporting/spec/models/cost_query/chaining_spec.rb b/modules/reporting/spec/models/cost_query/chaining_spec.rb
index 95aec317c50..f378f29e24a 100644
--- a/modules/reporting/spec/models/cost_query/chaining_spec.rb
+++ b/modules/reporting/spec/models/cost_query/chaining_spec.rb
@@ -34,14 +34,15 @@ describe CostQuery, reporting_query_helper: true do
minimal_query
describe '#chain' do
- before do
+ around do |example|
# FIXME: is there a better way to load all filter and groups?
CostQuery::Filter.all && CostQuery::GroupBy.all
+ previous_chain_initializer = described_class.chain_initializer.dup
described_class.chain_initializer.clear
- end
-
- after(:all) do
+ example.run
+ ensure
described_class.chain_initializer.clear
+ described_class.chain_initializer.push(*previous_chain_initializer)
end
it "contains NoFilter" do