summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-29 18:32:41 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-29 18:32:41 +0000
commit9f148e098b07e95e2d7088844b111bb8c1280d87 (patch)
treeffe2d6ff1f819c95f1ac2491508e451b39d9d199 /test
parent1fc324b74c089e2d74d0ba189aee80316f7cad68 (diff)
downloadredmine-9f148e098b07e95e2d7088844b111bb8c1280d87.tar.gz
redmine-9f148e098b07e95e2d7088844b111bb8c1280d87.zip
Ability to sort issues by grouped column (#3511).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10765 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/issues_controller_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index a6917d2f9..69545bf92 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -297,6 +297,26 @@ class IssuesControllerTest < ActionController::TestCase
end
end
+ def test_index_with_query_grouped_by_tracker
+ 3.times {|i| Issue.generate!(:tracker_id => (i + 1))}
+
+ get :index, :set_filter => 1, :group_by => 'tracker', :sort => 'id:desc'
+ assert_response :success
+
+ trackers = assigns(:issues).map(&:tracker).uniq
+ assert_equal [1, 2, 3], trackers.map(&:id)
+ end
+
+ def test_index_with_query_grouped_by_tracker_in_reverse_order
+ 3.times {|i| Issue.generate!(:tracker_id => (i + 1))}
+
+ get :index, :set_filter => 1, :group_by => 'tracker', :sort => 'id:desc,tracker:desc'
+ assert_response :success
+
+ trackers = assigns(:issues).map(&:tracker).uniq
+ assert_equal [3, 2, 1], trackers.map(&:id)
+ end
+
def test_index_with_query_id_and_project_id_should_set_session_query
get :index, :project_id => 1, :query_id => 4
assert_response :success