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

add spec for gates to definition managing spec

ulfertscbf013e6fb2d
diff --git a/spec/features/admin/project_phase_definitions_spec.rb b/spec/features/admin/project_phase_definitions_spec.rb
index 61431f25a2a..b8a969b6bde 100644
--- a/spec/features/admin/project_phase_definitions_spec.rb
+++ b/spec/features/admin/project_phase_definitions_spec.rb
@@ -115,12 +115,27 @@ RSpec.describe "Projects phase definition settings", :js, with_flag: { stages_an
definitions_page.select_color("Azure")
click_on "Create"
+ definitions_page.expect_and_dismiss_flash(message: "Successful creation.")
+
+ definitions_page.expect_gates_mentioned_for("Imagining", "No gate")
+
definitions_page.add
fill_in "Name", with: "Initiating"
definitions_page.select_color("Gold")
+
+ click_on "Phase gates"
+
+ check "Start phase gate"
+ fill_in "Start phase gate name", with: "Ready to Initiate"
+ check "Finish phase gate"
+ fill_in "Finish phase gate name", with: "Finished initiating"
+
click_on "Create"
+ definitions_page.expect_and_dismiss_flash(message: "Successful creation.")
+
definitions_page.expect_listed(["Starting", "Processing", "Imagining", "Initiating"])
+ definitions_page.expect_gates_mentioned_for("Initiating", "Start and finish gate")
# moving
definitions_page.click_definition_action("Processing", action: "Move to bottom")
diff --git a/spec/support/pages/admin/settings/project_phase_definitions.rb b/spec/support/pages/admin/settings/project_phase_definitions.rb
index 50b91584778..a06d4d3286b 100644
--- a/spec/support/pages/admin/settings/project_phase_definitions.rb
+++ b/spec/support/pages/admin/settings/project_phase_definitions.rb
@@ -57,6 +57,12 @@ module Pages
end
end
+ def expect_gates_mentioned_for(definition, gates_string)
+ within page.find(test_selector("project-phase-definition"), text: definition) do
+ expect(page).to have_content(gates_string)
+ end
+ end
+
def filter_with(string)
fill_in I18n.t("settings.project_phase_definitions.filter.label"), with: string
end