summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-11-26 05:44:35 +0000
committerGo MAEDA <maeda@farend.jp>2018-11-26 05:44:35 +0000
commita046f0db7b65ee807ba3496ac45249ec09e86cf1 (patch)
tree60cfe96deb5b10719c3928a2a4aca02dfa1e7c8d /test
parenta7f6830a8e374c4419c4754468e0198558209b51 (diff)
downloadredmine-a046f0db7b65ee807ba3496ac45249ec09e86cf1.tar.gz
redmine-a046f0db7b65ee807ba3496ac45249ec09e86cf1.zip
Merged r17638 from trunk to 3.4-stable (#30009).
git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@17639 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 dfa2ace6d..c7c8e97f7 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_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']}