# rows
pdf.SetFontStyle('',8)
pdf.SetFillColor(255, 255, 255)
- group = false
+ previous_group = false
issues.each do |issue|
- if query.grouped? && issue.send(query.group_by) != group
- group = issue.send(query.group_by)
+ if query.grouped? && (group = query.group_by_column.value(issue)) != previous_group
pdf.SetFontStyle('B',9)
- pdf.Cell(277, row_height, "#{group.blank? ? 'None' : group.to_s}", 1, 1, 'L')
+ pdf.Cell(277, row_height,
+ (group.blank? ? 'None' : group.to_s) + " (#{@issue_count_by_group[group]})",
+ 1, 1, 'L')
pdf.SetFontStyle('',8)
+ previous_group = group
end
pdf.Cell(15, row_height, issue.id.to_s, 1, 0, 'L', 1)
query.columns.each_with_index do |column, i|
assert_equal 'application/pdf', @response.content_type
end
+ def test_index_pdf_with_query_grouped_by_list_custom_field
+ get :index, :project_id => 1, :query_id => 9, :format => 'pdf'
+ assert_response :success
+ assert_not_nil assigns(:issues)
+ assert_not_nil assigns(:issue_count_by_group)
+ assert_equal 'application/pdf', @response.content_type
+ end
+
def test_index_sort
get :index, :sort => 'tracker,id:desc'
assert_response :success