summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2022-03-27 21:34:10 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2022-03-27 21:34:10 +0000
commit60b5a5864beee093b83cd1d5dc4a1df3fb8a1839 (patch)
tree4260b0e154d43bd64dac71dca91737ea3c21fc3e /test/unit
parenteb03ee3cda8d1a6c9a10bd7e2db2e13d26e20dc5 (diff)
downloadredmine-60b5a5864beee093b83cd1d5dc4a1df3fb8a1839.tar.gz
redmine-60b5a5864beee093b83cd1d5dc4a1df3fb8a1839.zip
Merged r21499, r21500 and r21501 to 4.1-stable (#30924).
git-svn-id: https://svn.redmine.org/redmine/branches/4.1-stable@21505 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/query_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb
index 92fb1f179..3c33e0e4b 100644
--- a/test/unit/query_test.rb
+++ b/test/unit/query_test.rb
@@ -1126,6 +1126,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']}}
+ assert_not_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'})