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 flaky test

Christophe Bliardb45fb80724f5
diff --git a/spec/support/multi_json_issue_workaround.rb b/spec/support/multi_json_issue_workaround.rb
new file mode 100644
index 00000000000..0603209b557
--- /dev/null
+++ b/spec/support/multi_json_issue_workaround.rb
@@ -0,0 +1,11 @@
+# Multi_json issue #208 https://github.com/intridea/multi_json/issues/208
+# produces a `NoMethodError` with some tests like
+# modules/bim/spec/requests/api/bcf/v2_1/viewpoints_api_spec.rb:277 where grape
+# is calling multi_json with a specific adapter. It will fail if it is the first
+# test executed.
+#
+# Calling this will prevent the error from happening
+MultiJson::OptionsCache.reset
+
+# This file can be removed once the issue has been fixed and released in a new
+# version of multi_json gem (issue exists in 1.15.0)