diff options
author | Go MAEDA <maeda@farend.jp> | 2021-05-07 04:47:24 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2021-05-07 04:47:24 +0000 |
commit | 512b594cb4af6239b3b98da4bae8129b805cfdff (patch) | |
tree | ea3770699af2443e3750391b064973d6f0ada577 /test | |
parent | 7d78ed78b08641e22c2968642fd78a53c63f0af1 (diff) | |
download | redmine-512b594cb4af6239b3b98da4bae8129b805cfdff.tar.gz redmine-512b594cb4af6239b3b98da4bae8129b805cfdff.zip |
Merged r20990 from trunk to 4.2-stable (#35201).
git-svn-id: http://svn.redmine.org/redmine/branches/4.2-stable@20991 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/query_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb index 75efaae8a..0c8f68c94 100644 --- a/test/unit/query_test.rb +++ b/test/unit/query_test.rb @@ -1519,6 +1519,19 @@ class QueryTest < ActiveSupport::TestCase end end + def test_available_filters_as_json_should_not_include_duplicate_assigned_to_id_values + set_language_if_valid 'en' + user = User.find_by_login 'dlopper' + with_current_user User.find(1) do + q = IssueQuery.new + q.filters = {"assigned_to_id" => {:operator => '=', :values => user.id.to_s}} + + filters = q.available_filters_as_json + assert_not_include [user.name, user.id.to_s], filters['assigned_to_id']['values'] + assert_include [user.name, user.id.to_s, 'active'], filters['assigned_to_id']['values'] + end + end + def test_available_filters_as_json_should_include_missing_author_id_values user = User.generate! with_current_user User.find(1) do |