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

Update failing spec

Christophe Bliard15e2602f6041
diff --git a/spec/features/work_packages/tabs/relations_children_spec.rb b/spec/features/work_packages/tabs/relations_children_spec.rb
index 28128971dcb..449ebbba8db 100644
--- a/spec/features/work_packages/tabs/relations_children_spec.rb
+++ b/spec/features/work_packages/tabs/relations_children_spec.rb
@@ -95,9 +95,13 @@ RSpec.describe "Relations children tab", :js, :with_cuprite do
context "when work package is a milestone and user does not have manage_work_package_relations permission" do
let(:work_package) { create(:work_package, type: type_milestone, project:, subject: "Milestone") }
- it "does not show the action" do
+ it "shows only the action to add a parent" do
wp_page.visit_tab!("relations")
- relations_tab.expect_no_add_relation_button
+ relations_tab.expect_add_relation_button
+ relations_tab.expect_no_new_relation_type("Related to")
+ relations_tab.expect_no_new_relation_type("Child")
+ relations_tab.expect_no_new_relation_type("Create new child")
+ relations_tab.expect_new_relation_type("Parent")
end
end
@@ -116,6 +120,7 @@ RSpec.describe "Relations children tab", :js, :with_cuprite do
relations_tab.expect_new_relation_type("Related to")
relations_tab.expect_no_new_relation_type("Child")
relations_tab.expect_no_new_relation_type("Create new child")
+ relations_tab.expect_new_relation_type("Parent")
end
end
@@ -139,7 +144,7 @@ RSpec.describe "Relations children tab", :js, :with_cuprite do
end
end
- context "without permissions to add children" do
+ context "without permissions to add children or parent (:manage_subtasks)" do
let!(:user) do
create(:user, member_with_permissions: { project => %i[view_work_packages] })
end
@@ -155,11 +160,12 @@ RSpec.describe "Relations children tab", :js, :with_cuprite do
create(:user, member_with_permissions: { project => %i[view_work_packages manage_subtasks] })
end
- it "shows an action to add 'Child', but not to 'Create new child'" do
+ it "shows an action to add 'Child' or 'Parent', but not to 'Create new child'" do
wp_page.visit_tab!("relations")
relations_tab.expect_add_relation_button
relations_tab.expect_new_relation_type("Child")
relations_tab.expect_no_new_relation_type("Create new child")
+ relations_tab.expect_new_relation_type("Parent")
end
end