From 22165fd071227de3f893319974d8568b2fb8ebc1 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sat, 24 Aug 2019 08:50:17 +0000 Subject: Per role visibility settings for version custom fields (#23997). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Jens Krämer and Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@18386 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/custom_fields_controller_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test') diff --git a/test/functional/custom_fields_controller_test.rb b/test/functional/custom_fields_controller_test.rb index 101a4c34f..7f41888ff 100644 --- a/test/functional/custom_fields_controller_test.rb +++ b/test/functional/custom_fields_controller_test.rb @@ -146,6 +146,26 @@ class CustomFieldsControllerTest < Redmine::ControllerTest end end + def test_new_version_custom_field + get :new, :params => { + :type => 'VersionCustomField' + } + 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=VersionCustomField]' + end + end + def test_new_time_entry_custom_field_should_not_show_trackers_and_projects get :new, :params => { :type => 'TimeEntryCustomField' -- cgit v1.2.3