mirror of
https://github.com/redmine/redmine.git
synced 2025-11-03 20:06:24 +01:00
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:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user