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

Create view in query factory so that the queries are visible in the sidemenu again

Henriette Darge9e79561886fa
diff --git a/spec/factories/query_factory.rb b/spec/factories/query_factory.rb
index 02062a06d56..38ca72456c9 100644
--- a/spec/factories/query_factory.rb
+++ b/spec/factories/query_factory.rb
@@ -30,6 +30,11 @@ FactoryBot.define do
factory :query do
project
user factory: :user
+
+ transient do
+ view { :view_work_packages_table }
+ end
+
sequence(:name) { |n| "Query #{n}" }
factory :public_query do
@@ -48,6 +53,10 @@ FactoryBot.define do
sequence(:name) { |n| "Global query #{n}" }
end
- callback(:after_build) { |query| query.add_default_filter }
+ callback(:after_build) do |query, evaluator|
+ query.add_default_filter
+ FactoryBot.create(evaluator.view,
+ query: query)
+ end
end
end