summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-02-09 00:27:15 +0000
committerGo MAEDA <maeda@farend.jp>2020-02-09 00:27:15 +0000
commit40c063287f7417450223828eb687adbeaa84c596 (patch)
treecc5985217e3383b1c7c12c09e526d0edb029fb54
parent5278efdbee68708e68c6aa044ae9a8be318683d9 (diff)
downloadredmine-40c063287f7417450223828eb687adbeaa84c596.tar.gz
redmine-40c063287f7417450223828eb687adbeaa84c596.zip
Merged r19501 from trunk to 4.1-stable (#32959).
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@19502 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/helpers/timelog_helper.rb2
-rw-r--r--test/functional/timelog_controller_test.rb15
2 files changed, 16 insertions, 1 deletions
diff --git a/app/helpers/timelog_helper.rb b/app/helpers/timelog_helper.rb
index 2c3e500a5..d10b57332 100644
--- a/app/helpers/timelog_helper.rb
+++ b/app/helpers/timelog_helper.rb
@@ -44,7 +44,7 @@ module TimelogHelper
def user_collection_for_select_options(time_entry)
collection = time_entry.assignable_users
- principals_options_for_select(collection, time_entry.user_id)
+ principals_options_for_select(collection, time_entry.user_id.to_s)
end
def select_hours(data, criteria, value)
diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb
index f23c9601d..2dd0d9e00 100644
--- a/test/functional/timelog_controller_test.rb
+++ b/test/functional/timelog_controller_test.rb
@@ -1433,4 +1433,19 @@ class TimelogControllerTest < Redmine::ControllerTest
assert_response :success
assert_select "td.issue_cf_#{field.id}", :text => 'This is a long text'
end
+
+ def test_edit_for_other_user
+ Role.find_by_name('Manager').add_permission! :log_time_for_other_users
+ @request.session[:user_id] = 2
+
+ get :edit, :params => {
+ :id => 1
+ }
+
+ assert_response :success
+
+ assert_select 'select[name=?]', 'time_entry[user_id]' do
+ assert_select 'option[value="2"][selected=selected]'
+ end
+ end
end