diff --git a/lib/open_project/xls_export/patches/work_packages_controller_patch.rb b/lib/open_project/xls_export/patches/work_packages_controller_patch.rb index 770b791f30..dd7e4bbffb 100644 --- a/lib/open_project/xls_export/patches/work_packages_controller_patch.rb +++ b/lib/open_project/xls_export/patches/work_packages_controller_patch.rb @@ -39,7 +39,7 @@ module OpenProject::XlsExport sb = SpreadsheetBuilder.new("#{I18n.t(:label_work_package_plural)}") formatters = OpenProject::XlsExport::Formatters.for_columns(columns) - headers = columns.collect(&:caption).unshift("#") + headers = columns.collect(&:caption) headers << WorkPackage.human_attribute_name(:description) if options[:show_descriptions] sb.add_headers headers, 0 @@ -48,14 +48,14 @@ module OpenProject::XlsExport cv = formatters[column].format work_package, column cv = cv.in_time_zone(current_user.time_zone) if cv.is_a?(ActiveSupport::TimeWithZone) (cv.respond_to? :name) ? cv.name : cv - end).unshift(work_package.id) + end) row << work_package.description if options[:show_descriptions] sb.add_row(row) end columns.each_with_index do |column, i| options = formatters[column].format_options column - sb.add_format_option_to_column i + 1, options + sb.add_format_option_to_column i, options end sb diff --git a/spec/patches/work_packages_controller_patch_spec.rb b/spec/patches/work_packages_controller_patch_spec.rb index 8b42ca7a1e..5a66f83f1b 100644 --- a/spec/patches/work_packages_controller_patch_spec.rb +++ b/spec/patches/work_packages_controller_patch_spec.rb @@ -100,7 +100,7 @@ describe WorkPackagesController, "rendering to xls", :type => :controller do it 'should include estimated hours' do expect(@sheet.rows.size).to eq(4 + 1) - hours = @sheet.rows.last.values_at(3) + hours = @sheet.rows.last.values_at(2) expect(hours).to include(27.5) end end