first pass RT4 merge, RT#13852
[freeside.git] / rt / t / web / cf_render_type.t
1 use strict;
2 use warnings;
3
4 use RT::Test tests => 8;
5
6 my ($baseurl, $m) = RT::Test->started_ok;
7 ok $m->login, 'logged in as root';
8
9 my $cf_name = 'test render type';
10
11 my $cfid;
12 diag "Create a CF";
13 {
14     $m->follow_link( id => 'tools-config-custom-fields-create');
15     $m->submit_form(
16         form_name => "ModifyCustomField",
17         fields => {
18             Name          => $cf_name,
19             TypeComposite => 'Freeform-1',
20             LookupType    => 'RT::Queue-RT::Ticket',
21         },
22     );
23     $m->content_contains('Object created', 'created Freeform-1' );
24     $cfid = $m->form_name('ModifyCustomField')->value('id');
25     ok $cfid, "found id of the CF in the form, it's #$cfid";
26 }
27
28 diag "change to Select type";
29 {
30     $m->submit_form(
31         form_name => "ModifyCustomField",
32         fields    => { TypeComposite => 'Select-1', },
33         button    => 'Update',
34     );
35     $m->content_contains(
36         "Type changed from 'Enter one value' to 'Select one value'",
37         'changed to Select-1' );
38 }
39
40 diag "let's save it again";
41 {
42     $m->submit_form(
43         form_name => "ModifyCustomField",
44         button    => 'Update',
45     );
46     $m->content_lacks( "Render Type changed from '1' to 'Select box'",
47         'no buggy RenderType change msg' );
48 }
49
50