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

fix mock functions

as-opbae85361b46a
diff --git a/spec/features/work_packages/generate_pdf_spec.rb b/spec/features/work_packages/generate_pdf_spec.rb
index 931cee1765a..eae07690cd0 100644
--- a/spec/features/work_packages/generate_pdf_spec.rb
+++ b/spec/features/work_packages/generate_pdf_spec.rb
@@ -71,10 +71,12 @@ RSpec.describe "work package PDF generator", :js, :selenium, with_flag: { genera
end
def mock_generating_pdf
- allow(WorkPackage::PDFExport::DocumentGenerator).to
- receive(:new)
- .with(work_package, has_mandatory_params(expected_params))
- .and_return(document_generator)
+ allow(WorkPackage::PDFExport::DocumentGenerator)
+ .to receive(:new)
+ .and_return(document_generator)
+ allow(document_generator)
+ .to receive(:initialize)
+ .with(work_package, has_mandatory_params(expected_params))
allow(document_generator)
.to receive(:export!)
.and_return(