Feature #32436 » timelog-issue-groupable.diff
| app/models/time_entry_query.rb | ||
|---|---|---|
|
QueryColumn.new(:author, :sortable => lambda {User.fields_for_order_statement}),
|
||
|
QueryColumn.new(:user, :sortable => lambda {User.fields_for_order_statement}, :groupable => true),
|
||
|
QueryColumn.new(:activity, :sortable => "#{TimeEntryActivity.table_name}.position", :groupable => true),
|
||
|
QueryColumn.new(:issue, :sortable => "#{Issue.table_name}.id"),
|
||
|
QueryColumn.new(:issue, :sortable => "#{Issue.table_name}.id", :groupable => true),
|
||
|
QueryAssociationColumn.new(:issue, :tracker, :caption => :field_tracker, :sortable => "#{Tracker.table_name}.position"),
|
||
|
QueryAssociationColumn.new(:issue, :status, :caption => :field_status, :sortable => "#{IssueStatus.table_name}.position"),
|
||
|
QueryAssociationColumn.new(:issue, :category, :caption => :field_category, :sortable => "#{IssueCategory.table_name}.name"),
|
||
| test/functional/timelog_controller_test.rb | ||
|---|---|---|
|
assert_select '+ span.count', :text => '2'
|
||
|
end
|
||
|
end
|
||
|
def test_index_grouped_by_issue
|
||
|
get :index, :params => {
|
||
|
:set_filter => 1,
|
||
|
:group_by => 'issue'
|
||
|
}
|
||
|
assert_response :success
|
||
|
assert_select 'tr.group span.name' do |elements|
|
||
|
target_element = elements[1]
|
||
|
assert_equal "Bug #1: Cannot print recipes", target_element.text
|
||
|
assert_select target_element, '+ span.count', :text => '2'
|
||
|
end
|
||
|
end
|
||
|
end
|
||