@@ -126,8 +126,8 class Query < ActiveRecord::Base | |||
|
126 | 126 | :list_subprojects => [ "*", "!*", "=" ], |
|
127 | 127 | :date => [ "=", ">=", "<=", "><", "<t+", ">t+", "t+", "t", "w", ">t-", "<t-", "t-", "!*", "*" ], |
|
128 | 128 | :date_past => [ "=", ">=", "<=", "><", ">t-", "<t-", "t-", "t", "w", "!*", "*" ], |
|
129 | :string => [ "=", "~", "!", "!~" ], | |
|
130 | :text => [ "~", "!~" ], | |
|
129 | :string => [ "=", "~", "!", "!~", "!*", "*" ], | |
|
130 | :text => [ "~", "!~", "!*", "*" ], | |
|
131 | 131 | :integer => [ "=", ">=", "<=", "><", "!*", "*" ], |
|
132 | 132 | :float => [ "=", ">=", "<=", "><", "!*", "*" ] } |
|
133 | 133 |
@@ -21,6 +21,7 custom_fields_002: | |||
|
21 | 21 | min_length: 1 |
|
22 | 22 | regexp: "" |
|
23 | 23 | is_for_all: true |
|
24 | is_filter: true | |
|
24 | 25 | type: IssueCustomField |
|
25 | 26 | max_length: 100 |
|
26 | 27 | possible_values: "" |
@@ -112,6 +112,15 class QueryTest < ActiveSupport::TestCase | |||
|
112 | 112 | assert issues.all? {|i| i.start_date.nil?} |
|
113 | 113 | end |
|
114 | 114 | |
|
115 | def test_operator_none_for_string_custom_field | |
|
116 | query = Query.new(:project => Project.find(1), :name => '_') | |
|
117 | query.add_filter('cf_2', '!*', ['']) | |
|
118 | assert query.has_filter?('cf_2') | |
|
119 | issues = find_issues_with_query(query) | |
|
120 | assert !issues.empty? | |
|
121 | assert issues.all? {|i| i.custom_field_value(2).blank?} | |
|
122 | end | |
|
123 | ||
|
115 | 124 | def test_operator_all |
|
116 | 125 | query = Query.new(:project => Project.find(1), :name => '_') |
|
117 | 126 | query.add_filter('fixed_version_id', '*', ['']) |
@@ -129,6 +138,15 class QueryTest < ActiveSupport::TestCase | |||
|
129 | 138 | assert issues.all? {|i| i.start_date.present?} |
|
130 | 139 | end |
|
131 | 140 | |
|
141 | def test_operator_all_for_string_custom_field | |
|
142 | query = Query.new(:project => Project.find(1), :name => '_') | |
|
143 | query.add_filter('cf_2', '*', ['']) | |
|
144 | assert query.has_filter?('cf_2') | |
|
145 | issues = find_issues_with_query(query) | |
|
146 | assert !issues.empty? | |
|
147 | assert issues.all? {|i| i.custom_field_value(2).present?} | |
|
148 | end | |
|
149 | ||
|
132 | 150 | def test_numeric_filter_should_not_accept_non_numeric_values |
|
133 | 151 | query = Query.new(:name => '_') |
|
134 | 152 | query.add_filter('estimated_hours', '=', ['a']) |
General Comments 0
You need to be logged in to leave comments.
Login now