diff options
author | Go MAEDA <maeda@farend.jp> | 2024-01-03 07:34:06 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2024-01-03 07:34:06 +0000 |
commit | d42887b579000c8737b9508891e3fe634db86b2a (patch) | |
tree | 514cc82d31a63df9a5755337d02ba71bcb641e12 /test | |
parent | 8b0a4fb197906c61788734037240a25817c8ec5d (diff) | |
download | redmine-d42887b579000c8737b9508891e3fe634db86b2a.tar.gz redmine-d42887b579000c8737b9508891e3fe634db86b2a.zip |
Merged r22583 from trunk to 5.1-stable (#39991).
git-svn-id: https://svn.redmine.org/redmine/branches/5.1-stable@22587 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/query_test.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb index 52195e584..dd328c6b6 100644 --- a/test/unit/query_test.rb +++ b/test/unit/query_test.rb @@ -214,7 +214,7 @@ class QueryTest < ActiveSupport::TestCase assert issues.all? {|i| i.custom_field_value(2).blank?} end - def test_operator_none_for_text + def test_operator_none_for_blank_text query = IssueQuery.new(:name => '_') query.add_filter('status_id', '*', ['']) query.add_filter('description', '!*', ['']) @@ -226,6 +226,19 @@ class QueryTest < ActiveSupport::TestCase assert_equal [11, 12], issues.map(&:id).sort end + def test_operator_any_for_blank_text + Issue.where(id: [1, 2]).update_all(description: '') + query = IssueQuery.new(:name => '_') + query.add_filter('status_id', '*', ['']) + query.add_filter('description', '*', ['']) + assert query.has_filter?('description') + issues = find_issues_with_query(query) + + assert issues.any? + assert issues.all? {|i| i.description.present?} + assert_empty issues.map(&:id) & [1, 2] + end + def test_operator_all query = IssueQuery.new(:project => Project.find(1), :name => '_') query.add_filter('fixed_version_id', '*', ['']) |