##// END OF EJS Templates
Adds a way to filter issues with or without start date (#9607)....
Jean-Philippe Lang -
r7721:12d05431c20e
parent child
Show More
@@ -120,8 +120,8 class Query < ActiveRecord::Base
120 120 :list_status => [ "o", "=", "!", "c", "*" ],
121 121 :list_optional => [ "=", "!", "!*", "*" ],
122 122 :list_subprojects => [ "*", "!*", "=" ],
123 :date => [ "=", ">=", "<=", "><", "<t+", ">t+", "t+", "t", "w", ">t-", "<t-", "t-" ],
124 :date_past => [ "=", ">=", "<=", "><", ">t-", "<t-", "t-", "t", "w" ],
123 :date => [ "=", ">=", "<=", "><", "<t+", ">t+", "t+", "t", "w", ">t-", "<t-", "t-", "!*", "*" ],
124 :date_past => [ "=", ">=", "<=", "><", ">t-", "<t-", "t-", "t", "w", "!*", "*" ],
125 125 :string => [ "=", "~", "!", "!~" ],
126 126 :text => [ "~", "!~" ],
127 127 :integer => [ "=", ">=", "<=", "><", "!*", "*" ],
@@ -97,6 +97,14 class QueryTest < ActiveSupport::TestCase
97 97 assert issues.all? {|i| !i.estimated_hours}
98 98 end
99 99
100 def test_operator_none_for_date
101 query = Query.new(:project => Project.find(1), :name => '_')
102 query.add_filter('start_date', '!*', [''])
103 issues = find_issues_with_query(query)
104 assert !issues.empty?
105 assert issues.all? {|i| i.start_date.nil?}
106 end
107
100 108 def test_operator_all
101 109 query = Query.new(:project => Project.find(1), :name => '_')
102 110 query.add_filter('fixed_version_id', '*', [''])
@@ -106,6 +114,14 class QueryTest < ActiveSupport::TestCase
106 114 find_issues_with_query(query)
107 115 end
108 116
117 def test_operator_all_for_date
118 query = Query.new(:project => Project.find(1), :name => '_')
119 query.add_filter('start_date', '*', [''])
120 issues = find_issues_with_query(query)
121 assert !issues.empty?
122 assert issues.all? {|i| i.start_date.present?}
123 end
124
109 125 def test_numeric_filter_should_not_accept_non_numeric_values
110 126 query = Query.new(:name => '_')
111 127 query.add_filter('estimated_hours', '=', ['a'])
General Comments 0
You need to be logged in to leave comments. Login now