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

Remove old gates

Dombi Attilaab1b4ee9b7e0
diff --git a/spec/features/projects/life_cycle/overview_page/dialog/permission_spec.rb b/spec/features/projects/life_cycle/overview_page/dialog/permission_spec.rb
index 96587546eb6..6641794b5ac 100644
--- a/spec/features/projects/life_cycle/overview_page/dialog/permission_spec.rb
+++ b/spec/features/projects/life_cycle/overview_page/dialog/permission_spec.rb
@@ -30,7 +30,7 @@ require "spec_helper"
require_relative "../shared_context"
RSpec.describe "Edit project stages and gates on project overview page", :js, with_flag: { stages_and_gates: true } do
- include_context "with seeded projects and stages and gates"
+ include_context "with seeded projects and phases"
shared_let(:user) { create(:user) }
let(:overview_page) { Pages::Projects::Show.new(project) }
let(:permissions) { [] }
diff --git a/spec/features/projects/life_cycle/overview_page/dialog/update_spec.rb b/spec/features/projects/life_cycle/overview_page/dialog/update_spec.rb
index 98c58e4ca51..469b66b3c43 100644
--- a/spec/features/projects/life_cycle/overview_page/dialog/update_spec.rb
+++ b/spec/features/projects/life_cycle/overview_page/dialog/update_spec.rb
@@ -32,7 +32,7 @@ require "spec_helper"
require_relative "../shared_context"
RSpec.describe "Edit project stages and gates on project overview page", :js, with_flag: { stages_and_gates: true } do
- include_context "with seeded projects and stages and gates"
+ include_context "with seeded projects and phases"
shared_let(:overview) { create :overview, project: }
@@ -56,12 +56,9 @@ RSpec.describe "Edit project stages and gates on project overview page", :js, wi
dialog = overview_page.open_edit_dialog_for_life_cycles
dialog.expect_input("Initiating", value: "", position: 1)
- dialog.expect_input("Ready for Planning", value: "", position: 2)
- dialog.expect_input("Planning", value: "", position: 3)
- dialog.expect_input("Ready for Executing", value: "", position: 4)
- dialog.expect_input("Executing", value: "", position: 5)
- dialog.expect_input("Ready for Closing", value: "", position: 6)
- dialog.expect_input("Closing", value: "", position: 7)
+ dialog.expect_input("Planning", value: "", position: 2)
+ dialog.expect_input("Executing", value: "", position: 3)
+ dialog.expect_input("Closing", value: "", position: 4)
# Saving the dialog is successful
dialog.submit
@@ -101,7 +98,7 @@ RSpec.describe "Edit project stages and gates on project overview page", :js, wi
expect(page.driver.browser.network.traffic.size).to eq(1)
end
- dialog.clear_date_for(life_cycle_ready_for_planning)
+ dialog.clear_date_for(life_cycle_planning)
# Saving the dialog is successful
dialog.submit
@@ -113,11 +110,11 @@ RSpec.describe "Edit project stages and gates on project overview page", :js, wi
end
ready_for_planning_dates = [
- life_cycle_ready_for_planning.start_date,
- life_cycle_ready_for_planning.finish_date
+ life_cycle_planning.start_date,
+ life_cycle_planning.finish_date
].map { I18n.l(it) }.join("\n-\n")
- overview_page.within_life_cycle_container(life_cycle_ready_for_planning) do
+ overview_page.within_life_cycle_container(life_cycle_planning) do
expect(page).to have_no_text ready_for_planning_dates
end
@@ -128,8 +125,8 @@ RSpec.describe "Edit project stages and gates on project overview page", :js, wi
life_cycle_initiating_was = life_cycle_initiating.dup
life_cycle_initiating.reload
- life_cycle_ready_for_planning_was = life_cycle_ready_for_planning.dup
- life_cycle_ready_for_planning.reload
+ life_cycle_planning_was = life_cycle_planning.dup
+ life_cycle_planning.reload
activity_page.within_journal(number: 1) do
activity_page.expect_activity("Initiating changed from " \
@@ -138,9 +135,9 @@ RSpec.describe "Edit project stages and gates on project overview page", :js, wi
"#{I18n.l life_cycle_initiating.start_date} - " \
"#{I18n.l life_cycle_initiating.finish_date}")
- activity_page.expect_activity("Ready for Planning date deleted " \
- "#{I18n.l life_cycle_ready_for_planning_was.start_date} - " \
- "#{I18n.l life_cycle_ready_for_planning_was.finish_date}")
+ activity_page.expect_activity("Planning date deleted " \
+ "#{I18n.l life_cycle_planning_was.start_date} - " \
+ "#{I18n.l life_cycle_planning_was.finish_date}")
end
end
@@ -159,9 +156,9 @@ RSpec.describe "Edit project stages and gates on project overview page", :js, wi
# Retrying due to a race condition between filling the input vs submitting the form preview.
retry_block do
values = [start_date + cycled_days.next.days] * 2
- dialog.set_date_for(life_cycle_ready_for_planning, values:)
+ dialog.set_date_for(life_cycle_planning, values:)
- dialog.expect_validation_message(life_cycle_ready_for_planning, text: expected_text)
+ dialog.expect_validation_message(life_cycle_planning, text: expected_text)
end
# Saving the dialog fails
@@ -169,13 +166,13 @@ RSpec.describe "Edit project stages and gates on project overview page", :js, wi
dialog.expect_open
# The validation message is kept after the unsuccessful save attempt
- dialog.expect_validation_message(life_cycle_ready_for_planning, text: expected_text)
+ dialog.expect_validation_message(life_cycle_planning, text: expected_text)
retry_block do
# The validation message is cleared when date is changed
values = [start_date + 2.days + cycled_days.next.days] * 2
- dialog.set_date_for(life_cycle_ready_for_planning, values:)
- dialog.expect_no_validation_message(life_cycle_ready_for_planning)
+ dialog.set_date_for(life_cycle_planning, values:)
+ dialog.expect_no_validation_message(life_cycle_planning)
end
# Saving the dialog is successful
@@ -186,19 +183,19 @@ RSpec.describe "Edit project stages and gates on project overview page", :js, wi
activity_page.show_details
- life_cycle_ready_for_planning_was = life_cycle_ready_for_planning.dup
- life_cycle_ready_for_planning.reload
+ life_cycle_planning_was = life_cycle_planning.dup
+ life_cycle_planning.reload
activity_page.within_journal(number: 1) do
expected_date_from = [
- I18n.l(life_cycle_ready_for_planning_was.start_date),
- I18n.l(life_cycle_ready_for_planning_was.finish_date)
+ I18n.l(life_cycle_planning_was.start_date),
+ I18n.l(life_cycle_planning_was.finish_date)
].join(" - ")
expected_date_to = [
- I18n.l(life_cycle_ready_for_planning.start_date),
- I18n.l(life_cycle_ready_for_planning.finish_date)
+ I18n.l(life_cycle_planning.start_date),
+ I18n.l(life_cycle_planning.finish_date)
].join(" - ")
- activity_page.expect_activity("Ready for Planning changed from " \
+ activity_page.expect_activity("Planning changed from " \
"#{expected_date_from} to " \
"#{expected_date_to}")
end
diff --git a/spec/features/projects/life_cycle/overview_page/shared_context.rb b/spec/features/projects/life_cycle/overview_page/shared_context.rb
index cfda439b532..6e47af778bb 100644
--- a/spec/features/projects/life_cycle/overview_page/shared_context.rb
+++ b/spec/features/projects/life_cycle/overview_page/shared_context.rb
@@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-RSpec.shared_context "with seeded projects and stages and gates" do
+RSpec.shared_context "with seeded projects and phases" do
shared_let(:project) { create(:project, name: "Foo project", identifier: "foo-project") }
shared_let(:standard) { create(:standard_global_role) }
shared_let(:admin) { create(:admin) }
@@ -34,20 +34,11 @@ RSpec.shared_context "with seeded projects and stages and gates" do
shared_let(:life_cycle_initiating_definition) do
create :project_phase_definition, name: "Initiating"
end
- shared_let(:life_cycle_ready_for_planning_definition) do
- create :project_phase_definition, :with_gates, name: "Ready for Planning"
- end
shared_let(:life_cycle_planning_definition) do
- create :project_phase_definition, name: "Planning"
- end
- shared_let(:life_cycle_ready_for_executing_definition) do
- create :project_phase_definition, :with_gates, name: "Ready for Executing"
+ create :project_phase_definition, :with_gates, name: "Planning"
end
shared_let(:life_cycle_executing_definition) do
- create :project_phase_definition, name: "Executing"
- end
- shared_let(:life_cycle_ready_for_closing_definition) do
- create :project_phase_definition, :with_gates, name: "Ready for Closing"
+ create :project_phase_definition, :with_gates, name: "Executing"
end
shared_let(:life_cycle_closing_definition) do
create :project_phase_definition, name: "Closing"
@@ -62,13 +53,6 @@ RSpec.shared_context "with seeded projects and stages and gates" do
finish_date: start_date + 1.day,
project:
end
- let(:life_cycle_ready_for_planning) do
- create :project_phase,
- definition: life_cycle_ready_for_planning_definition,
- start_date: start_date + 2.days,
- finish_date: start_date + 2.days,
- project:
- end
let(:life_cycle_planning) do
create :project_phase,
definition: life_cycle_planning_definition,
@@ -76,13 +60,6 @@ RSpec.shared_context "with seeded projects and stages and gates" do
finish_date: start_date + 7.days,
project:
end
- let(:life_cycle_ready_for_executing) do
- create :project_phase,
- definition: life_cycle_ready_for_executing_definition,
- start_date: start_date + 8.days,
- finish_date: start_date + 8.days,
- project:
- end
let(:life_cycle_executing) do
create :project_phase,
definition: life_cycle_executing_definition,
@@ -90,13 +67,6 @@ RSpec.shared_context "with seeded projects and stages and gates" do
finish_date: start_date + 10.days,
project:
end
- let(:life_cycle_ready_for_closing) do
- create :project_phase,
- definition: life_cycle_ready_for_closing_definition,
- start_date: start_date + 11.days,
- finish_date: start_date + 11.days,
- project:
- end
let(:life_cycle_closing) do
create :project_phase,
definition: life_cycle_closing_definition,
@@ -108,11 +78,8 @@ RSpec.shared_context "with seeded projects and stages and gates" do
let!(:project_life_cycles) do
[
life_cycle_initiating,
- life_cycle_ready_for_planning,
life_cycle_planning,
- life_cycle_ready_for_executing,
life_cycle_executing,
- life_cycle_ready_for_closing,
life_cycle_closing
]
end
diff --git a/spec/features/projects/life_cycle/overview_page/sidebar_spec.rb b/spec/features/projects/life_cycle/overview_page/sidebar_spec.rb
index 26dfc4679f1..469e7aa6b8e 100644
--- a/spec/features/projects/life_cycle/overview_page/sidebar_spec.rb
+++ b/spec/features/projects/life_cycle/overview_page/sidebar_spec.rb
@@ -32,7 +32,7 @@ require "spec_helper"
require_relative "shared_context"
RSpec.describe "Show project life cycles on project overview page", :js, with_flag: { stages_and_gates: true } do
- include_context "with seeded projects and stages and gates"
+ include_context "with seeded projects and phases"
let(:overview_page) { Pages::Projects::Show.new(project) }
@@ -68,30 +68,24 @@ RSpec.describe "Show project life cycles on project overview page", :js, with_fl
overview_page.within_life_cycles_sidebar do
expected_stages = [
"Initiating",
- "Ready for Planning",
"Planning",
- "Ready for Executing",
"Executing",
- "Ready for Closing",
"Closing"
]
fields = page.all(".op-project-life-cycle-container > div:first-child")
expect(fields.map(&:text)).to eq(expected_stages)
end
- life_cycle_ready_for_executing_definition.move_to_bottom
+ life_cycle_executing_definition.move_to_bottom
overview_page.visit_page
overview_page.within_life_cycles_sidebar do
expected_stages = [
"Initiating",
- "Ready for Planning",
"Planning",
- "Executing",
- "Ready for Closing",
"Closing",
- "Ready for Executing"
+ "Executing"
]
fields = page.all(".op-project-life-cycle-container > div:first-child")
expect(fields.map(&:text)).to eq(expected_stages)
@@ -99,12 +93,12 @@ RSpec.describe "Show project life cycles on project overview page", :js, with_fl
end
it "does not show stages and gates not enabled for this project in a sidebar" do
- life_cycle_ready_for_executing.toggle!(:active)
+ life_cycle_executing.toggle!(:active)
overview_page.visit_page
overview_page.within_life_cycles_sidebar do
- expect(page).to have_no_text life_cycle_ready_for_executing.name
+ expect(page).to have_no_text life_cycle_executing.name
end
end
end