diff options
author | Go MAEDA <maeda@farend.jp> | 2021-03-15 23:32:52 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2021-03-15 23:32:52 +0000 |
commit | c54349cc0b33dcc3f2a6a17661cc0d216e0e8736 (patch) | |
tree | dd3993dfe17b897ce8919f0c0f1a257a91023257 /test/functional | |
parent | f7ebb0d9aaa09dde4f25267093c7a999f7dcba38 (diff) | |
download | redmine-c54349cc0b33dcc3f2a6a17661cc0d216e0e8736.tar.gz redmine-c54349cc0b33dcc3f2a6a17661cc0d216e0e8736.zip |
Do not display in issue edit page spent time custom fields not visible by the user (#33550).
Patch by Marius BALTEANU.
git-svn-id: http://svn.redmine.org/redmine/trunk@20801 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/issues_controller_test.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 91d11c6c8..45217b696 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -5658,6 +5658,41 @@ class IssuesControllerTest < Redmine::ControllerTest assert_select 'span.icon-warning[title=?]', reason, :text => reason end + def test_get_edit_should_display_visible_spent_time_custom_field + @request.session[:user_id] = 2 + + get( + :edit, + :params => { + :id => 13, + } + ) + + assert_response :success + + assert_select '#issue-form select.cf_10', 1 + end + + def test_get_edit_should_not_display_spent_time_custom_field_not_visible + cf = TimeEntryCustomField.find(10) + cf.visible = false + cf.role_ids = [1] + cf.save! + + @request.session[:user_id] = 2 + + get( + :edit, + :params => { + :id => 13, + } + ) + + assert_response :success + + assert_select '#issue-form select.cf_10', 0 + end + def test_update_form_for_existing_issue @request.session[:user_id] = 2 patch( |