4 use RT::Test tests => 14;
5 my ($baseurl, $m) = RT::Test->started_ok;
7 ok $m->login, 'logged in';
9 diag "Create a queue CF";
11 $m->follow_link( id => 'tools-config-custom-fields-create');
13 form_name => "ModifyCustomField",
15 TypeComposite => 'Freeform-1',
16 LookupType => 'RT::Queue',
17 Name => 'QueueCFTest',
18 Description => 'QueueCFTest',
21 $m->content_contains('Object created', 'CF QueueCFTest created' );
24 diag "Apply the new CF globally";
26 $m->follow_link( text => 'Global' );
27 $m->title_is(q!Admin/Global configuration!, 'global configuration screen');
28 $m->follow_link( url_regex => qr!Admin/Global/CustomFields/index! );
29 $m->title_is(q/Global custom field configuration/, 'global custom field configuration screen');
30 $m->follow_link( url => 'Queues.html' );
31 $m->title_is(q/Edit Custom Fields for all queues/, 'global custom field for all queues configuration screen');
32 $m->content_contains('QueueCFTest', 'CF QueueCFTest displayed on page' );
34 $m->form_name('EditCustomFields');
35 $m->tick( AddCustomField => 1 );
36 $m->click('UpdateCFs');
38 $m->content_contains('Object created', 'CF QueueCFTest enabled globally' );
41 diag "Edit the CF value for default queue";
43 $m->follow_link( url => '/Admin/Queues/' );
44 $m->title_is(q/Admin queues/, 'queues configuration screen');
45 $m->follow_link( text => "1" );
46 $m->title_is(q/Configuration for queue General/, 'default queue configuration screen');
47 $m->content_contains('QueueCFTest', 'CF QueueCFTest displayed on default queue' );
50 # The following doesn't want to works :(
51 #with_fields => { 'Object-RT::Queue-1-CustomField-1-Value' },
53 'Object-RT::Queue-1-CustomField-1-Value' => 'QueueCFTest content',
56 $m->content_contains('QueueCFTest QueueCFTest content added', 'Content filed in CF QueueCFTest for default queue' );