Merge pull request #23696 from opf/feature/stc-729-adapt-excel-and-csv-exports-for-semantic-identifiers

[STC-729] Support semantic identifiers in Excel and CSV exports
This commit is contained in:
Tom Hykel
2026-06-12 12:45:29 +02:00
committed by GitHub
4 changed files with 92 additions and 0 deletions
@@ -246,6 +246,25 @@ RSpec.describe XlsExport::WorkPackage::Exporter::XLS do
end
end
context "with semantic work package identifiers",
with_settings: { work_packages_identifier: "semantic" } do
let(:project) { create(:project, identifier: "XLSPROJ") }
let(:work_package) do
create(:work_package,
project:,
type: project.types.first)
end
let(:work_packages) { [work_package] }
let(:column_names) { %w[id subject] }
it "exports the semantic identifier in the ID column" do
expect(sheet.rows.size).to eq(1 + 1)
expect(work_package.identifier).to match(/\AXLSPROJ-\d+\z/)
expect(sheet.rows[1][0]).to eq work_package.identifier
end
end
context "with underscore in subject" do
let(:work_package) do
create(:work_package,