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

use the automatically built project_phase_definition

as-op2d414f6d387e
diff --git a/spec/models/work_package/pdf_export/common/macro_spec.rb b/spec/models/work_package/pdf_export/common/macro_spec.rb
index 636a0850944..12d7773c7d0 100644
--- a/spec/models/work_package/pdf_export/common/macro_spec.rb
+++ b/spec/models/work_package/pdf_export/common/macro_spec.rb
@@ -184,14 +184,13 @@ RSpec.describe WorkPackage::PDFExport::Common::Macro do
describe "with project_phase attribute" do
let(:project_phase_active) { true }
- let(:phase_definition) { create(:project_phase_definition, name: "Test Phase") }
let!(:project_phase) do
- create(:project_phase, project: project, definition: phase_definition, active: project_phase_active)
+ create(:project_phase, project: project, active: project_phase_active)
end
let(:markdown) { "workPackageValue:project_phase" }
before do
- work_package.update!(project_phase_definition_id: phase_definition.id)
+ work_package.update!(project_phase_definition_id: project_phase.definition.id)
end
describe "without the permission" do
@@ -205,7 +204,7 @@ RSpec.describe WorkPackage::PDFExport::Common::Macro do
describe "with active phase" do
it "outputs the project phase name" do
- expect(formatted).to eq("Test Phase")
+ expect(formatted).to eq(project_phase.name)
end
end