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

[#49690] Sums table only shows total sum

as-opf662162d0899
diff --git a/spec/models/work_packages/pdf_export/work_package_list_to_pdf_spec.rb b/spec/models/work_packages/pdf_export/work_package_list_to_pdf_spec.rb
index b8040318acf..879226e9fbb 100644
--- a/spec/models/work_packages/pdf_export/work_package_list_to_pdf_spec.rb
+++ b/spec/models/work_packages/pdf_export/work_package_list_to_pdf_spec.rb
@@ -261,7 +261,7 @@ RSpec.describe WorkPackage::PDFExport::WorkPackageListToPdf do
let(:query_attributes) { { display_sums: true, group_by: 'type' } }
it 'contains correct data' do
- expect(pdf.strings).to eq([
+ expect(pdf.strings).to eq([
*cover_page_content,
query.name,
'1.', '2', work_package_parent.subject,
@@ -278,4 +278,29 @@ RSpec.describe WorkPackage::PDFExport::WorkPackageListToPdf do
])
end
end
+
+ describe 'with a request for a PDF Report grouped by a custom field with sums' do
+ let(:options) { { show_report: true } }
+ let(:query_attributes) { { display_sums: true, group_by: list_custom_field.column_name } }
+
+ it 'contains correct data' do
+ expect(pdf.strings).to eq([
+ *cover_page_content,
+ query.name,
+ '1.', '2', work_package_child.subject,
+ '2.', '2', work_package_parent.subject,
+ '1/2', export_time_formatted, query.name,
+ I18n.t('js.work_packages.tabs.overview'),
+ list_custom_field.name.upcase, column_title(:story_points),
+
+ "Foo", work_package_child.story_points.to_s,
+ "Foo, Bar", work_package_parent.story_points.to_s,
+ I18n.t('js.label_sum'), work_packages_sum.to_s,
+
+ *work_package_details(work_package_child, "1"),
+ *work_package_details(work_package_parent, "2"),
+ '2/2', export_time_formatted, query.name
+ ])
+ end
+ end
end