summaryrefslogtreecommitdiffstats
path: root/test/functional/watchers_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-11 13:08:52 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-11 13:08:52 +0000
commitbdd3ccf8e52c69d2b6e16e7230a1b8f9a6c69e60 (patch)
tree1571b147765d42bccab602cdd9a79499829de612 /test/functional/watchers_controller_test.rb
parent140ca9532c1c12b7ff710c076c6985dce18500e4 (diff)
downloadredmine-bdd3ccf8e52c69d2b6e16e7230a1b8f9a6c69e60.tar.gz
redmine-bdd3ccf8e52c69d2b6e16e7230a1b8f9a6c69e60.zip
Adds a role setting for controlling visibility of users: all or members of visible projects (#11724).
git-svn-id: http://svn.redmine.org/redmine/trunk@13584 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/watchers_controller_test.rb')
-rw-r--r--test/functional/watchers_controller_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/watchers_controller_test.rb b/test/functional/watchers_controller_test.rb
index dc72a9b6b..628ad0550 100644
--- a/test/functional/watchers_controller_test.rb
+++ b/test/functional/watchers_controller_test.rb
@@ -227,6 +227,21 @@ class WatchersControllerTest < ActionController::TestCase
assert Issue.find(2).watched_by?(user)
end
+ def test_autocomplete_for_user_should_return_visible_users
+ Role.update_all :users_visibility => 'members_of_visible_projects'
+
+ hidden = User.generate!(:lastname => 'autocomplete')
+ visible = User.generate!(:lastname => 'autocomplete')
+ User.add_to_project(visible, Project.find(1))
+
+ @request.session[:user_id] = 2
+ xhr :get, :autocomplete_for_user, :q => 'autocomp', :project_id => 'ecookbook'
+ assert_response :success
+
+ assert_include visible, assigns(:users)
+ assert_not_include hidden, assigns(:users)
+ end
+
def test_append
@request.session[:user_id] = 2
assert_no_difference 'Watcher.count' do