1610 |
1610 |
def test_sort_criteria_should_have_only_first_three_elements
|
1611 |
1611 |
q = IssueQuery.new
|
1612 |
1612 |
q.sort_criteria = [['priority', 'desc'], ['tracker', 'asc'], ['priority', 'asc'], ['id', 'asc'], ['project', 'asc'], ['subject', 'asc']]
|
1613 |
|
assert_equal [['priority', 'desc'], ['tracker', 'asc'], ['priority', 'asc']], q.sort_criteria
|
|
1613 |
assert_equal [['priority', 'desc'], ['tracker', 'asc'], ['id', 'asc']], q.sort_criteria
|
1614 |
1614 |
end
|
1615 |
1615 |
|
1616 |
|
def test_sort_criteria_should_remove_blank_keys
|
|
1616 |
def test_sort_criteria_should_remove_blank_or_duplicate_keys
|
1617 |
1617 |
q = IssueQuery.new
|
1618 |
|
q.sort_criteria = [['priority', 'desc'], [nil, 'desc'], ['', 'asc'], ['project', 'asc']]
|
|
1618 |
q.sort_criteria = [['priority', 'desc'], [nil, 'desc'], ['', 'asc'], ['priority', 'asc'], ['project', 'asc']]
|
1619 |
1619 |
assert_equal [['priority', 'desc'], ['project', 'asc']], q.sort_criteria
|
1620 |
1620 |
end
|
1621 |
1621 |
|