git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.4-stable@9672 e93f8b46-1217-0410-a6f0-8f06a7374b81tags/1.4.2
:list_subprojects => [ "*", "!*", "=" ], | :list_subprojects => [ "*", "!*", "=" ], | ||||
:date => [ "=", ">=", "<=", "><", "<t+", ">t+", "t+", "t", "w", ">t-", "<t-", "t-", "!*", "*" ], | :date => [ "=", ">=", "<=", "><", "<t+", ">t+", "t+", "t", "w", ">t-", "<t-", "t-", "!*", "*" ], | ||||
:date_past => [ "=", ">=", "<=", "><", ">t-", "<t-", "t-", "t", "w", "!*", "*" ], | :date_past => [ "=", ">=", "<=", "><", ">t-", "<t-", "t-", "t", "w", "!*", "*" ], | ||||
:string => [ "=", "~", "!", "!~" ], | |||||
:text => [ "~", "!~" ], | |||||
:string => [ "=", "~", "!", "!~", "!*", "*" ], | |||||
:text => [ "~", "!~", "!*", "*" ], | |||||
:integer => [ "=", ">=", "<=", "><", "!*", "*" ], | :integer => [ "=", ">=", "<=", "><", "!*", "*" ], | ||||
:float => [ "=", ">=", "<=", "><", "!*", "*" ] } | :float => [ "=", ">=", "<=", "><", "!*", "*" ] } | ||||
min_length: 1 | min_length: 1 | ||||
regexp: "" | regexp: "" | ||||
is_for_all: true | is_for_all: true | ||||
is_filter: true | |||||
type: IssueCustomField | type: IssueCustomField | ||||
max_length: 100 | max_length: 100 | ||||
possible_values: "" | possible_values: "" |
assert issues.all? {|i| i.start_date.nil?} | assert issues.all? {|i| i.start_date.nil?} | ||||
end | end | ||||
def test_operator_none_for_string_custom_field | |||||
query = Query.new(:project => Project.find(1), :name => '_') | |||||
query.add_filter('cf_2', '!*', ['']) | |||||
assert query.has_filter?('cf_2') | |||||
issues = find_issues_with_query(query) | |||||
assert !issues.empty? | |||||
assert issues.all? {|i| i.custom_field_value(2).blank?} | |||||
end | |||||
def test_operator_all | def test_operator_all | ||||
query = Query.new(:project => Project.find(1), :name => '_') | query = Query.new(:project => Project.find(1), :name => '_') | ||||
query.add_filter('fixed_version_id', '*', ['']) | query.add_filter('fixed_version_id', '*', ['']) | ||||
assert issues.all? {|i| i.start_date.present?} | assert issues.all? {|i| i.start_date.present?} | ||||
end | end | ||||
def test_operator_all_for_string_custom_field | |||||
query = Query.new(:project => Project.find(1), :name => '_') | |||||
query.add_filter('cf_2', '*', ['']) | |||||
assert query.has_filter?('cf_2') | |||||
issues = find_issues_with_query(query) | |||||
assert !issues.empty? | |||||
assert issues.all? {|i| i.custom_field_value(2).present?} | |||||
end | |||||
def test_numeric_filter_should_not_accept_non_numeric_values | def test_numeric_filter_should_not_accept_non_numeric_values | ||||
query = Query.new(:name => '_') | query = Query.new(:name => '_') | ||||
query.add_filter('estimated_hours', '=', ['a']) | query.add_filter('estimated_hours', '=', ['a']) |