diff options
author | Go MAEDA <maeda@farend.jp> | 2023-05-01 14:33:22 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2023-05-01 14:33:22 +0000 |
commit | 5352225a8ca5bab25a51c3f4169a98cda364fc86 (patch) | |
tree | 09d132f343df5f1f8482f757f3db004c0247af9d /test | |
parent | 88d4fcd270c28398beea1cd2b3080373cc3c231f (diff) | |
download | redmine-5352225a8ca5bab25a51c3f4169a98cda364fc86.tar.gz redmine-5352225a8ca5bab25a51c3f4169a98cda364fc86.zip |
Make the "Any searchable text" filter search only open issues when the status filter is set to "open" (#38402).
git-svn-id: https://svn.redmine.org/redmine/trunk@22221 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/query_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb index 283bb2e16..6087616b0 100644 --- a/test/unit/query_test.rb +++ b/test/unit/query_test.rb @@ -1071,6 +1071,21 @@ class QueryTest < ActiveSupport::TestCase result.each {|issue| assert_includes [1, 5], issue.project_id} end + def test_filter_any_searchable_with_open_issues_should_search_only_open_issues + User.current = User.find(1) + query = IssueQuery.new( + :name => '_', + :filters => { + 'status_id' => {:operator => 'o'} + } + ) + + result = query.sql_for_any_searchable_field(nil, '~', ['issue']) + assert_match /issues.id IN \([\d,]+\)/, result + ids = result.scan(/\d+/).map(&:to_i).sort + assert_equal [4, 5, 6, 7, 9, 10, 13, 14], ids + end + def test_filter_updated_by user = User.generate! Journal.create!(:user_id => user.id, :journalized => Issue.find(2), :notes => 'Notes') |