mirror of
https://github.com/redmine/redmine.git
synced 2025-11-13 00:36:01 +01:00
Add support for "start with" and "end with" operators to "Files" filter (#31879).
Patch by Yuichi HARADA. git-svn-id: http://svn.redmine.org/redmine/trunk@18570 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -1353,6 +1353,20 @@ class QueryTest < ActiveSupport::TestCase
|
||||
assert_nil issues.detect {|issue| issue.attachments.any? {|attachment| attachment.filename.include?('error281')}}
|
||||
end
|
||||
|
||||
def test_filter_on_attachment_when_starts_with
|
||||
query = IssueQuery.new(:name => '_')
|
||||
query.filters = {"attachment" => {:operator => '^', :values => ['testfile']}}
|
||||
issues = find_issues_with_query(query)
|
||||
assert_equal [14], issues.collect(&:id).sort
|
||||
end
|
||||
|
||||
def test_filter_on_attachment_when_ends_with
|
||||
query = IssueQuery.new(:name => '_')
|
||||
query.filters = {"attachment" => {:operator => '$', :values => ['zip']}}
|
||||
issues = find_issues_with_query(query)
|
||||
assert_equal [3, 4], issues.collect(&:id).sort
|
||||
end
|
||||
|
||||
def test_filter_on_subject_when_starts_with
|
||||
query = IssueQuery.new(:name => '_')
|
||||
query.filters = {'subject' => {:operator => '^', :values => ['issue']}}
|
||||
|
||||
Reference in New Issue
Block a user