summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-11-26 05:22:04 +0000
committerGo MAEDA <maeda@farend.jp>2018-11-26 05:22:04 +0000
commit14d441a144aabc35cb75605755e924eefb6ed377 (patch)
tree48deef4ffc065a7c34ca30e55b7e84c1c80b849b /test
parent7fbcb8c908ae23dbf40c02a71c1f7abe78e3f5cb (diff)
downloadredmine-14d441a144aabc35cb75605755e924eefb6ed377.tar.gz
redmine-14d441a144aabc35cb75605755e924eefb6ed377.zip
Remove blank keys from sort criteria (#30009).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17638 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 1a66bc4db..e868ef456 100644
--- a/test/unit/query_test.rb
+++ b/test/unit/query_test.rb
@@ -1496,6 +1496,12 @@ class QueryTest < ActiveSupport::TestCase
assert_equal [['priority', 'desc'], ['tracker', 'asc'], ['priority', 'asc']], q.sort_criteria
end
+ def test_sort_criteria_should_remove_blank_keys
+ q = IssueQuery.new
+ q.sort_criteria = [['priority', 'desc'], [nil, 'desc'], ['', 'asc'], ['project', 'asc']]
+ assert_equal [['priority', 'desc'], ['project', 'asc']], q.sort_criteria
+ end
+
def test_set_sort_criteria_with_hash
q = IssueQuery.new
q.sort_criteria = {'0' => ['priority', 'desc'], '2' => ['tracker']}