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" if $ENV{'TEST_VERBOSE'};
11 $m->follow_link( text => 'Configuration' );
12 $m->title_is(q/RT Administration/, 'admin screen');
13 $m->follow_link( text => 'Custom Fields' );
14 $m->title_is(q/Select a Custom Field/, 'admin-cf screen');
15 $m->follow_link( text => 'Create' );
17 form_name => "ModifyCustomField",
19 TypeComposite => 'Freeform-1',
20 LookupType => 'RT::Queue',
21 Name => 'QueueCFTest',
22 Description => 'QueueCFTest',
25 $m->content_like( qr/Object created/, 'CF QueueCFTest created' );
28 diag "Apply the new CF globally" if $ENV{'TEST_VERBOSE'};
30 $m->follow_link( text => 'Global' );
31 $m->title_is(q!Admin/Global configuration!, 'global configuration screen');
32 $m->follow_link( url_regex => qr!Admin/Global/CustomFields/index! );
33 $m->title_is(q/Global custom field configuration/, 'global custom field configuration screen');
34 $m->follow_link( url => 'Queues.html' );
35 $m->title_is(q/Edit Custom Fields for all queues/, 'global custom field for all queues configuration screen');
36 $m->content_like( qr/QueueCFTest/, 'CF QueueCFTest displayed on page' );
38 $m->form_name('EditCustomFields');
39 $m->tick( AddCustomField => 1 );
40 $m->click('UpdateCFs');
42 $m->content_like( qr/Object created/, 'CF QueueCFTest enabled globally' );
45 diag "Edit the CF value for default queue" if $ENV{'TEST_VERBOSE'};
47 $m->follow_link( url => '/Admin/Queues/' );
48 $m->title_is(q/Admin queues/, 'queues configuration screen');
49 $m->follow_link( text => "1" );
50 $m->title_is(q/Editing Configuration for queue General/, 'default queue configuration screen');
51 $m->content_like( qr/QueueCFTest/, 'CF QueueCFTest displayed on default queue' );
54 # The following doesn't want to works :(
55 #with_fields => { 'Object-RT::Queue-1-CustomField-1-Value' },
57 'Object-RT::Queue-1-CustomField-1-Value' => 'QueueCFTest content',
60 $m->content_like( qr/QueueCFTest QueueCFTest content added/, 'Content filed in CF QueueCFTest for default queue' );