first pass RT4 merge, RT#13852
[freeside.git] / rt / t / web / cf_render_type.t
diff --git a/rt/t/web/cf_render_type.t b/rt/t/web/cf_render_type.t
new file mode 100644 (file)
index 0000000..8d8efa8
--- /dev/null
@@ -0,0 +1,50 @@
+use strict;
+use warnings;
+
+use RT::Test tests => 8;
+
+my ($baseurl, $m) = RT::Test->started_ok;
+ok $m->login, 'logged in as root';
+
+my $cf_name = 'test render type';
+
+my $cfid;
+diag "Create a CF";
+{
+    $m->follow_link( id => 'tools-config-custom-fields-create');
+    $m->submit_form(
+        form_name => "ModifyCustomField",
+        fields => {
+            Name          => $cf_name,
+            TypeComposite => 'Freeform-1',
+            LookupType    => 'RT::Queue-RT::Ticket',
+        },
+    );
+    $m->content_contains('Object created', 'created Freeform-1' );
+    $cfid = $m->form_name('ModifyCustomField')->value('id');
+    ok $cfid, "found id of the CF in the form, it's #$cfid";
+}
+
+diag "change to Select type";
+{
+    $m->submit_form(
+        form_name => "ModifyCustomField",
+        fields    => { TypeComposite => 'Select-1', },
+        button    => 'Update',
+    );
+    $m->content_contains(
+        "Type changed from 'Enter one value' to 'Select one value'",
+        'changed to Select-1' );
+}
+
+diag "let's save it again";
+{
+    $m->submit_form(
+        form_name => "ModifyCustomField",
+        button    => 'Update',
+    );
+    $m->content_lacks( "Render Type changed from '1' to 'Select box'",
+        'no buggy RenderType change msg' );
+}
+
+