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

[#36743] add grandparent to spec

Tobias Dillmann262e82fd1e8e
diff --git a/spec/models/queries/work_packages/filter/ancestor_filter_spec.rb b/spec/models/queries/work_packages/filter/ancestor_filter_spec.rb
index fabba62aa97..f2fa70249fd 100644
--- a/spec/models/queries/work_packages/filter/ancestor_filter_spec.rb
+++ b/spec/models/queries/work_packages/filter/ancestor_filter_spec.rb
@@ -268,7 +268,8 @@ RSpec.describe Queries::WorkPackages::Filter::AncestorFilter do
end
describe "#where and #includes" do
- let(:parent) { create(:work_package) }
+ let(:grandparent) { create(:work_package) }
+ let(:parent) { create(:work_package, parent: grandparent) }
let(:child) { create(:work_package, parent:) }
let(:grandchild) { create(:work_package, parent: child) }
let(:another_wp) { create(:work_package) }
@@ -304,7 +305,7 @@ RSpec.describe Queries::WorkPackages::Filter::AncestorFilter do
.includes(instance.includes)
.where(instance.where)
- expect(scope).to contain_exactly(another_wp)
+ expect(scope).to contain_exactly(another_wp, grandparent)
end
end
end