diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-06-30 01:03:13 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-06-30 01:03:13 -0700 |
commit | f3c4966ed1f6ec3db7accd6dcdd3a5a3821d72a7 (patch) | |
tree | e5e9a077260613e6117d4697dd2985abd9b03d34 /rt/t/customfields/combo_cascade.t | |
parent | cf7cd8efc7095aadbdfb0cd8e7ea0e2e8b9e9085 (diff) | |
parent | cd3eb95ed1f3dc3e04cfc2b3b405f75b3ab086da (diff) |
merging RT 4.0.6
Diffstat (limited to 'rt/t/customfields/combo_cascade.t')
-rw-r--r-- | rt/t/customfields/combo_cascade.t | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/rt/t/customfields/combo_cascade.t b/rt/t/customfields/combo_cascade.t new file mode 100644 index 000000000..28eee4527 --- /dev/null +++ b/rt/t/customfields/combo_cascade.t @@ -0,0 +1,37 @@ +#!/usr/bin/perl +use warnings; +use strict; + +use RT::Test nodata => 1, tests => 11; + +my $q = RT::Queue->new($RT::SystemUser); +works($q->Create(Name => "CF-Pattern-".$$)); + +my $cf = RT::CustomField->new($RT::SystemUser); +my @cf_args = (Name => $q->Name, Type => 'Combobox', Queue => $q->id); + +works($cf->Create(@cf_args)); + +# Set some CFVs with Category markers + +my $t = RT::Ticket->new($RT::SystemUser); +my ($id,undef,$msg) = $t->Create(Queue => $q->id, Subject => 'CF Test'); +works($id,$msg); + +sub add_works { + works( + $cf->AddValue(Name => $_[0], Description => $_[0], Category => $_[1]) + ); +}; + +add_works('value1', '1. Category A'); +add_works('value2'); +add_works('value3', '1.1. A-sub one'); +add_works('value4', '1.2. A-sub two'); +add_works('value5', ''); + +my $cfv = $cf->Values->First; +is($cfv->Category, '1. Category A'); +works($cfv->SetCategory('1. Category AAA')); +is($cfv->Category, '1. Category AAA'); + |