summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-05-21 06:50:25 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-05-21 06:50:25 +0000
commit47fce166d07e1ea494cba284066fd62fc0b6ce7c (patch)
tree5e41b592fbe26687b1c8b9f0f7a58815d502e742
parent513640da15f254504f20340acf39a8645ab182f0 (diff)
downloadredmine-47fce166d07e1ea494cba284066fd62fc0b6ce7c.tar.gz
redmine-47fce166d07e1ea494cba284066fd62fc0b6ce7c.zip
Merged r15416 (#22808).
git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@15419 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/query.rb2
-rw-r--r--test/functional/issues_controller_test.rb16
2 files changed, 17 insertions, 1 deletions
diff --git a/app/models/query.rb b/app/models/query.rb
index d201b76db..fdb389411 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -546,7 +546,7 @@ class Query < ActiveRecord::Base
if grouped? && (column = group_by_column)
order = (sort_criteria_order_for(column.name) || column.default_order).try(:upcase)
column.sortable.is_a?(Array) ?
- column.sortable.collect {|s| "#{s} #{order}"}.join(',') :
+ column.sortable.collect {|s| "#{s} #{order}"} :
"#{column.sortable} #{order}"
end
end
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 3c687c64b..e2b06c87a 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -273,6 +273,22 @@ class IssuesControllerTest < ActionController::TestCase
assert_not_nil assigns(:issue_count_by_group)
end
+ def test_index_with_query_grouped_and_sorted_by_fixed_version
+ get :index, :project_id => 1, :set_filter => 1, :group_by => "fixed_version", :sort => "fixed_version"
+ assert_response :success
+ assert_template 'index'
+ assert_not_nil assigns(:issues)
+ assert_not_nil assigns(:issue_count_by_group)
+ end
+
+ def test_index_with_query_grouped_and_sorted_by_fixed_version_in_reverse_order
+ get :index, :project_id => 1, :set_filter => 1, :group_by => "fixed_version", :sort => "fixed_version:desc"
+ assert_response :success
+ assert_template 'index'
+ assert_not_nil assigns(:issues)
+ assert_not_nil assigns(:issue_count_by_group)
+ end
+
def test_index_with_query_grouped_by_list_custom_field
get :index, :project_id => 1, :query_id => 9
assert_response :success