summaryrefslogtreecommitdiffstats
path: root/test/unit/query_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-03-07 17:51:27 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-03-07 17:51:27 +0000
commit58ee62e23990799f1c6d733e1a9a7f046d004816 (patch)
tree3ccecb90e8dee903a424a96fdfc14f5a75898447 /test/unit/query_test.rb
parent29ad5b31e0721cb0194ef019289dba265e116f45 (diff)
downloadredmine-58ee62e23990799f1c6d733e1a9a7f046d004816.tar.gz
redmine-58ee62e23990799f1c6d733e1a9a7f046d004816.zip
Issue description filter's 'none' operator does not match issues with blank descriptions (#25077).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@16378 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/query_test.rb')
-rw-r--r--test/unit/query_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb
index 5a3283900..7f2ef3d1c 100644
--- a/test/unit/query_test.rb
+++ b/test/unit/query_test.rb
@@ -217,6 +217,18 @@ class QueryTest < ActiveSupport::TestCase
assert issues.all? {|i| i.custom_field_value(2).blank?}
end
+ def test_operator_none_for_text
+ 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.blank?}
+ assert_equal [11, 12], issues.map(&:id).sort
+ end
+
def test_operator_all
query = IssueQuery.new(:project => Project.find(1), :name => '_')
query.add_filter('fixed_version_id', '*', [''])