Per role visibility settings for spent time custom fields (#31859).

Patch by Marius BALTEANU.


git-svn-id: http://svn.redmine.org/redmine/trunk@18358 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2019-08-09 09:31:16 +00:00
parent 433d8a081f
commit 3c91a3d5b2
10 changed files with 172 additions and 93 deletions

View File

@@ -95,12 +95,37 @@ class CustomFieldsControllerTest < Redmine::ControllerTest
assert_select 'option[value=user]', :text => 'User'
assert_select 'option[value=version]', :text => 'Version'
end
# Visibility
assert_select 'input[type=radio][name=?]', 'custom_field[visible]', 2
assert_select 'input[type=checkbox][name=?]', 'custom_field[role_ids][]', 3
assert_select 'input[type=checkbox][name=?]', 'custom_field[project_ids][]', Project.count
assert_select 'input[type=hidden][name=?]', 'custom_field[project_ids][]', 1
assert_select 'input[type=hidden][name=type][value=IssueCustomField]'
end
end
def test_new_time_entry_custom_field
get :new, :params => {
:type => 'TimeEntryCustomField'
}
assert_response :success
assert_select 'form#custom_field_form' do
assert_select 'select#custom_field_field_format[name=?]', 'custom_field[field_format]' do
assert_select 'option[value=user]', :text => 'User'
assert_select 'option[value=version]', :text => 'Version'
end
# Visibility
assert_select 'input[type=radio][name=?]', 'custom_field[visible]', 2
assert_select 'input[type=checkbox][name=?]', 'custom_field[role_ids][]', 3
assert_select 'input[type=hidden][name=type][value=TimeEntryCustomField]'
end
end
def test_new_time_entry_custom_field_should_not_show_trackers_and_projects
get :new, :params => {
:type => 'TimeEntryCustomField'