diff options
author | Go MAEDA <maeda@farend.jp> | 2021-02-21 01:45:16 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2021-02-21 01:45:16 +0000 |
commit | a8072b0d0f201754cfc6f0867b642fdb43af6054 (patch) | |
tree | 017985ca1118605da3c0fb51897bd9bea7f2596a /test/helpers | |
parent | f8d96bb3598f4d3ffcdb0c4b8325e80ad9541128 (diff) | |
download | redmine-a8072b0d0f201754cfc6f0867b642fdb43af6054.tar.gz redmine-a8072b0d0f201754cfc6f0867b642fdb43af6054.zip |
Add an interface to filter activities by user (#33602).
Patch by Mizuki ISHIKAWA.
git-svn-id: http://svn.redmine.org/redmine/trunk@20752 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/helpers')
-rw-r--r-- | test/helpers/activities_helper_test.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/helpers/activities_helper_test.rb b/test/helpers/activities_helper_test.rb index 714eab14a..8f86aca9a 100644 --- a/test/helpers/activities_helper_test.rb +++ b/test/helpers/activities_helper_test.rb @@ -109,4 +109,24 @@ class ActivitiesHelperTest < Redmine::HelperTest sort_activity_events(events).map {|event, grouped| [event.name, grouped]} ) end + + def test_activity_authors_options_for_select_if_current_user_is_admin + User.current = User.find(1) + project = Project.find(1) + + options = [["<< #{l(:label_me)} >>", 1], ['Dave Lopper', 3], ['John Smith', 2], ['Redmine Admin', 1], ['User Misc', 8]] + assert_equal( + options_for_select(options, nil), + activity_authors_options_for_select(project, nil)) + end + + def test_activity_authors_options_for_select_if_current_user_is_anonymous + User.current = nil + project = Project.find(1) + + options = [['Dave Lopper', 3], ['John Smith', 2]] + assert_equal( + options_for_select(options, nil), + activity_authors_options_for_select(project, nil)) + end end |