mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-01 03:57:15 +00:00
Adds test for when filtering on invalid issue ids (#6118).
git-svn-id: http://svn.redmine.org/redmine/trunk@14305 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
98f2b30ac5
commit
156e3078e2
@ -898,6 +898,15 @@ class QueryTest < ActiveSupport::TestCase
|
||||
assert_equal [parent.id], find_issues_with_query(query).map(&:id).sort
|
||||
end
|
||||
|
||||
def test_filter_on_invalid_parent_should_return_no_results
|
||||
query = IssueQuery.new(:name => '_')
|
||||
query.filters = {"parent_id" => {:operator => '=', :values => '99999999999'}}
|
||||
assert_equal [], find_issues_with_query(query).map(&:id).sort
|
||||
|
||||
query.filters = {"parent_id" => {:operator => '~', :values => '99999999999'}}
|
||||
assert_equal [], find_issues_with_query(query)
|
||||
end
|
||||
|
||||
def test_filter_on_child
|
||||
Issue.delete_all
|
||||
parent = Issue.generate_with_descendants!
|
||||
@ -919,6 +928,15 @@ class QueryTest < ActiveSupport::TestCase
|
||||
assert_equal [grandchild, leaf].map(&:id).sort, find_issues_with_query(query).map(&:id).sort
|
||||
end
|
||||
|
||||
def test_filter_on_invalid_child_should_return_no_results
|
||||
query = IssueQuery.new(:name => '_')
|
||||
query.filters = {"child_id" => {:operator => '=', :values => '99999999999'}}
|
||||
assert_equal [], find_issues_with_query(query)
|
||||
|
||||
query.filters = {"child_id" => {:operator => '~', :values => '99999999999'}}
|
||||
assert_equal [].map(&:id).sort, find_issues_with_query(query)
|
||||
end
|
||||
|
||||
def test_statement_should_be_nil_with_no_filters
|
||||
q = IssueQuery.new(:name => '_')
|
||||
q.filters = {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user