Allow issue grouping by custom field (#2679).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3071 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Vendored
+19
@@ -134,4 +134,23 @@ queries_008:
|
||||
|
||||
user_id: 2
|
||||
column_names:
|
||||
queries_009:
|
||||
id: 9
|
||||
project_id:
|
||||
is_public: true
|
||||
name: Open issues grouped by list custom field
|
||||
filters: |
|
||||
---
|
||||
status_id:
|
||||
:values:
|
||||
- "1"
|
||||
:operator: o
|
||||
|
||||
user_id: 1
|
||||
column_names:
|
||||
group_by: cf_1
|
||||
sort_criteria: |
|
||||
---
|
||||
- - priority
|
||||
- desc
|
||||
|
||||
|
||||
@@ -171,12 +171,26 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
assert_nil assigns(:issue_count_by_group)
|
||||
end
|
||||
|
||||
def test_index_with_grouped_query
|
||||
def test_index_with_query_grouped_by_tracker
|
||||
get :index, :project_id => 1, :query_id => 6
|
||||
assert_response :success
|
||||
assert_template 'index.rhtml'
|
||||
assert_not_nil assigns(:issues)
|
||||
assert_not_nil assigns(:issue_count_by_group)
|
||||
count_by_group = assigns(:issue_count_by_group)
|
||||
assert_kind_of Hash, count_by_group
|
||||
assert_kind_of Tracker, count_by_group.keys.first
|
||||
assert_not_nil count_by_group[Tracker.find(1)]
|
||||
end
|
||||
|
||||
def test_index_with_query_grouped_by_list_custom_field
|
||||
get :index, :project_id => 1, :query_id => 9
|
||||
assert_response :success
|
||||
assert_template 'index.rhtml'
|
||||
assert_not_nil assigns(:issues)
|
||||
count_by_group = assigns(:issue_count_by_group)
|
||||
assert_kind_of Hash, count_by_group
|
||||
assert_kind_of String, count_by_group.keys.first
|
||||
assert_not_nil count_by_group['MySQL']
|
||||
end
|
||||
|
||||
def test_index_csv_with_project
|
||||
|
||||
@@ -197,6 +197,11 @@ class QueryTest < ActiveSupport::TestCase
|
||||
assert q.has_column?(c)
|
||||
end
|
||||
|
||||
def test_groupable_columns_should_include_custom_fields
|
||||
q = Query.new
|
||||
assert q.groupable_columns.detect {|c| c.is_a? QueryCustomFieldColumn}
|
||||
end
|
||||
|
||||
def test_default_sort
|
||||
q = Query.new
|
||||
assert_equal [], q.sort_criteria
|
||||
|
||||
Reference in New Issue
Block a user