diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2022-03-24 16:52:20 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2022-03-24 16:52:20 +0000 |
commit | 9b25b348c3087e681f8b117d287c233795051a3c (patch) | |
tree | 925b7c17ea1725f3401ccf7ed7882a86a4d649c9 /test | |
parent | 40ffbff49d82d959927660574c1127e0b982b88e (diff) | |
download | redmine-9b25b348c3087e681f8b117d287c233795051a3c.tar.gz redmine-9b25b348c3087e681f8b117d287c233795051a3c.zip |
Allow to filter issues by its version status with shared versions (#36824, #30924).
Patch by Holger Just.
git-svn-id: https://svn.redmine.org/redmine/trunk@21499 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 f27e8c41f..4c07d9c39 100644 --- a/test/unit/query_test.rb +++ b/test/unit/query_test.rb @@ -1235,6 +1235,21 @@ class QueryTest < ActiveSupport::TestCase assert_equal [1, 3, 7, 8], find_issues_with_query(query).map(&:id).uniq.sort end + def test_filter_on_fixed_version_status_respects_sharing + issue = Issue.generate!(:project_id => 1, :fixed_version_id => 7) + + filter_name = "fixed_version.status" + + query = IssueQuery.new(:name => '_', project: Project.find(1)) + assert_include filter_name, query.available_filters.keys + query.filters = {filter_name => {:operator => '=', :values => ['open']}} + assert_include issue, find_issues_with_query(query) + + query = IssueQuery.new(:name => '_', project: Project.find(1)) + query.filters = {filter_name => {:operator => '=', :values => ['closed']}} + refute_includes find_issues_with_query(query), issue + end + def test_filter_on_version_custom_field field = IssueCustomField.generate!(:field_format => 'version', :is_filter => true) issue = Issue.generate!(:project_id => 1, :tracker_id => 1, :custom_field_values => {field.id.to_s => '2'}) |