mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 21:57:30 +02:00
Remove duplicate keys from sort criteria (#32737).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@19636 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -1640,12 +1640,12 @@ class QueryTest < ActiveSupport::TestCase
|
||||
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
|
||||
assert_equal [['priority', 'desc'], ['tracker', 'asc'], ['id', 'asc']], q.sort_criteria
|
||||
end
|
||||
|
||||
def test_sort_criteria_should_remove_blank_keys
|
||||
def test_sort_criteria_should_remove_blank_or_duplicate_keys
|
||||
q = IssueQuery.new
|
||||
q.sort_criteria = [['priority', 'desc'], [nil, 'desc'], ['', 'asc'], ['project', 'asc']]
|
||||
q.sort_criteria = [['priority', 'desc'], [nil, 'desc'], ['', 'asc'], ['priority', 'asc'], ['project', 'asc']]
|
||||
assert_equal [['priority', 'desc'], ['project', 'asc']], q.sort_criteria
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user