summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-02-11 06:48:29 +0000
committerGo MAEDA <maeda@farend.jp>2021-02-11 06:48:29 +0000
commitf238663f2b844cb6b9d3e249071b0749ea2e4fcc (patch)
tree87257e402942ea93e6887165530700c4321ab4cf /test/functional
parentaf4c60825180c732e3110489750649f0017f1dc0 (diff)
downloadredmine-f238663f2b844cb6b9d3e249071b0749ea2e4fcc.tar.gz
redmine-f238663f2b844cb6b9d3e249071b0749ea2e4fcc.zip
Allow to use watch_by filter in the global issues list (#34700).
Patch by Holger Just. git-svn-id: http://svn.redmine.org/redmine/trunk@20744 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/queries_controller_test.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/functional/queries_controller_test.rb b/test/functional/queries_controller_test.rb
index f0a27f32b..a190aac39 100644
--- a/test/functional/queries_controller_test.rb
+++ b/test/functional/queries_controller_test.rb
@@ -895,4 +895,26 @@ class QueriesControllerTest < Redmine::ControllerTest
assert_include ["Dave2 Lopper2", "5", "locked"], json
assert_include ["A Team", "10", "active"], json
end
+
+ def test_watcher_filter_with_permission_should_show_members_and_groups_globally
+ # This user has view_issue_watchers permission
+ @request.session[:user_id] = 1
+ get(
+ :filter,
+ :params => {
+ :type => 'IssueQuery',
+ :name => 'watcher_id'
+ }
+ )
+ assert_response :success
+ assert_equal 'application/json', response.media_type
+ json = ActiveSupport::JSON.decode(response.body)
+
+ assert_equal 8, json.count
+ # "me" value should not be grouped
+ assert_include ['<< me >>', 'me'], json
+ assert_include ['Dave Lopper', '3', 'active'], json
+ assert_include ['Dave2 Lopper2', '5', 'locked'], json
+ assert_include ['A Team', '10', 'active'], json
+ end
end