summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-09-20 02:08:15 +0000
committerGo MAEDA <maeda@farend.jp>2018-09-20 02:08:15 +0000
commit1d596677f2053e9c5c157b2796ceb2a273c45687 (patch)
tree5d40a838551ed7e287c93147e0767505b1523fcd /test
parent4a5a68f19cda7de53ddd256fef71bf76a4512cd5 (diff)
downloadredmine-1d596677f2053e9c5c157b2796ceb2a273c45687.tar.gz
redmine-1d596677f2053e9c5c157b2796ceb2a273c45687.zip
Redmine::SortCriteria#normalize! does not limit properly the maximum number of elements (#29632).
Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@17494 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/query_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb
index aa29b2462..924a8f4f3 100644
--- a/test/unit/query_test.rb
+++ b/test/unit/query_test.rb
@@ -1490,6 +1490,12 @@ class QueryTest < ActiveSupport::TestCase
assert_equal [['id', 'desc']], q.sort_criteria
end
+ def test_sort_criteria_should_have_only_first_three_elements
+ q = IssueQuery.new
+ q.sort_criteria = [['priority', 'desc'], ['tracker', 'asc'], ['priority', 'asc'], ['id', 'asc'], ['project', 'asc'], ['subject', 'asc']]
+ assert_equal [['priority', 'desc'], ['tracker', 'asc'], ['priority', 'asc']], q.sort_criteria
+ end
+
def test_set_sort_criteria_with_hash
q = IssueQuery.new
q.sort_criteria = {'0' => ['priority', 'desc'], '2' => ['tracker']}