summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-02-01 23:31:52 +0000
committerGo MAEDA <maeda@farend.jp>2019-02-01 23:31:52 +0000
commitaca80173b64d1c4278f3dc3cddd5b47147081798 (patch)
tree5069ba80f47b1f02ec1e9991eb23b989b80e6063 /test/unit
parentf65f1d37bfa35bd27c8da1697dac24e2ef9f70c2 (diff)
downloadredmine-aca80173b64d1c4278f3dc3cddd5b47147081798.tar.gz
redmine-aca80173b64d1c4278f3dc3cddd5b47147081798.zip
Multiple issue ids in "Parent task" filter (#30482).
Patch by Yuichi HARADA. git-svn-id: http://svn.redmine.org/redmine/trunk@17843 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/query_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb
index 4950d9b1c..e180c3dae 100644
--- a/test/unit/query_test.rb
+++ b/test/unit/query_test.rb
@@ -280,6 +280,16 @@ class QueryTest < ActiveSupport::TestCase
assert_equal [1,3], issues.map(&:id).sort
end
+ def test_operator_is_on_parent_id_should_accept_comma_separated_values
+ Issue.where(:id => [2,4]).update_all(:parent_id => 1)
+ Issue.where(:id => 5).update_all(:parent_id => 3)
+ query = IssueQuery.new(:name => '_')
+ query.add_filter("parent_id", '=', ['1,3'])
+ issues = find_issues_with_query(query)
+ assert_equal 3, issues.size
+ assert_equal [2,4,5], issues.map(&:id).sort
+ end
+
def test_operator_between_on_issue_id_should_return_range
query = IssueQuery.new(:name => '_')
query.add_filter("issue_id", '><', ['2','3'])