summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2022-06-28 06:47:41 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2022-06-28 06:47:41 +0000
commit94ec29e9df148eae9178300650b31b65948688ba (patch)
treef8dc8084f20764368eccdce27e9f6334a61fac6e /test
parent56311ef8a63ba9be550bb46974f9a80731d0a9ef (diff)
downloadredmine-94ec29e9df148eae9178300650b31b65948688ba.tar.gz
redmine-94ec29e9df148eae9178300650b31b65948688ba.zip
Merged r21684 and r21685 to 5.0-stable (#37349).
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@21688 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/query_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb
index dbf95519f..da8e43b90 100644
--- a/test/unit/query_test.rb
+++ b/test/unit/query_test.rb
@@ -948,6 +948,18 @@ class QueryTest < ActiveSupport::TestCase
assert_equal issue1, result.first
end
+ def test_filter_on_chained_user_custom_field_of_type_float
+ user_cf = UserCustomField.find(5)
+ user_cf.update! is_filter: true
+
+ issue_cf = IssueCustomField.create!(:field_format => 'user', :is_for_all => true, :is_filter => true, :name => 'User custom field', :tracker_ids => [1])
+ issue1 = Issue.create!(:project_id => 1, :tracker_id => 1, :custom_field_values => {issue_cf.id.to_s => '2'}, :subject => 'Test', :author_id => 1)
+ query = IssueQuery.new(:name => '_', :project => Project.find(1))
+ query.filters = {"cf_#{issue_cf.id}.cf_#{user_cf.id}" => {:operator => '=', :values => ["30.1"]}}
+
+ assert query.issues
+ end
+
def test_filter_on_me_by_anonymous_user
User.current = nil
query =