X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=inline;f=rt%2Ft%2Fweb%2Fcf_values_class.t;fp=rt%2Ft%2Fweb%2Fcf_values_class.t;h=6466427819cb2d5affda7d92e7235c43685a9c70;hb=5b3efac57771fbc37874a3dd39d3df835cdd6133;hp=0000000000000000000000000000000000000000;hpb=008524b8e963831999983769f7fec11f55a72f16;p=freeside.git diff --git a/rt/t/web/cf_values_class.t b/rt/t/web/cf_values_class.t new file mode 100644 index 000000000..646642781 --- /dev/null +++ b/rt/t/web/cf_values_class.t @@ -0,0 +1,54 @@ +use strict; +use warnings; + +use RT::Test tests => 8; + +use constant VALUES_CLASS => 'RT::CustomFieldValues::Groups'; +RT->Config->Set(CustomFieldValuesSources => VALUES_CLASS); + +my ($baseurl, $m) = RT::Test->started_ok; +ok $m->login, 'logged in as root'; + +my $cf_name = 'test values class'; + +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 => 'Select-1', + LookupType => 'RT::Queue-RT::Ticket', + }, + ); + $m->content_contains('Object created', 'created Select-1' ); + $cfid = $m->form_name('ModifyCustomField')->value('id'); + ok $cfid, "found id of the CF in the form, it's #$cfid"; +} + +diag "change to external values class"; +{ + $m->submit_form( + form_name => "ModifyCustomField", + fields => { ValuesClass => 'RT::CustomFieldValues::Groups', }, + button => 'Update', + ); + $m->content_contains( + "Field values source changed from 'RT::CustomFieldValues' to 'RT::CustomFieldValues::Groups'", + 'changed to external values class' ); +} + +diag "change to internal values class"; +{ + $m->submit_form( + form_name => "ModifyCustomField", + fields => { ValuesClass => 'RT::CustomFieldValues', }, + button => 'Update', + ); + $m->content_contains( + "Field values source changed from 'RT::CustomFieldValues::Groups' to 'RT::CustomFieldValues'", + 'changed to internal values class' ); +} +