summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-04-16 05:46:52 +0000
committerGo MAEDA <maeda@farend.jp>2023-04-16 05:46:52 +0000
commit1f5c8742e3dfcc3546f10f032c3b61a2f6b6d7a6 (patch)
treeb0c0b96bf34222f6c6c007f8dc622d2ea7c8775e /test
parentea1c8ea319184e2d610e4cfd936849e8e6e81eda (diff)
downloadredmine-1f5c8742e3dfcc3546f10f032c3b61a2f6b6d7a6.tar.gz
redmine-1f5c8742e3dfcc3546f10f032c3b61a2f6b6d7a6.zip
Fix "contains any of" operator is not taken into account in File and File description filters (#38435).
git-svn-id: https://svn.redmine.org/redmine/trunk@22195 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/query_test.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb
index f58cd142d..2f09952e5 100644
--- a/test/unit/query_test.rb
+++ b/test/unit/query_test.rb
@@ -767,6 +767,36 @@ class QueryTest < ActiveSupport::TestCase
assert_equal [1, 2, 3], result.map(&:id).sort
end
+ def test_operator_contains_any_of_with_attachment
+ User.current = User.find(1)
+ query = IssueQuery.new(
+ :name => '_',
+ :filters => {
+ 'attachment' => {
+ :operator => '|~',
+ :values => ['source changeset']
+ }
+ }
+ )
+ result = find_issues_with_query(query)
+ assert_equal [2, 3], result.map(&:id).sort
+ end
+
+ def test_operator_contsins_any_of_with_attachment_description
+ User.current = User.find(1)
+ query = IssueQuery.new(
+ :name => '_',
+ :filters => {
+ 'attachment_description' => {
+ :operator => '|~',
+ :values => ['ruby issue']
+ }
+ }
+ )
+ result = find_issues_with_query(query)
+ assert_equal [2, 14], result.map(&:id).sort
+ end
+
def test_range_for_this_week_with_week_starting_on_monday
I18n.locale = :fr
assert_equal '1', I18n.t(:general_first_day_of_week)