[Rt-commit] r4079 - in rt/branches/3.4-RELEASE: . lib/t/regression

alexmv at bestpractical.com alexmv at bestpractical.com
Mon Nov 14 14:52:57 EST 2005


Author: alexmv
Date: Mon Nov 14 14:52:57 2005
New Revision: 4079

Modified:
   rt/branches/3.4-RELEASE/   (props changed)
   rt/branches/3.4-RELEASE/lib/t/regression/09record_cf_api.t
Log:
 r7148 at zoq-fot-pik:  chmrr | 2005-11-14 14:51:58 -0500
 RT-Ticket: 6559
 RT-Status: resolved
 RT-Update: correspond
  * Tests from Todd Chapman for loading CF from a wrong queue


Modified: rt/branches/3.4-RELEASE/lib/t/regression/09record_cf_api.t
==============================================================================
--- rt/branches/3.4-RELEASE/lib/t/regression/09record_cf_api.t	(original)
+++ rt/branches/3.4-RELEASE/lib/t/regression/09record_cf_api.t	Mon Nov 14 14:52:57 2005
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings FATAL => 'all';
-use Test::More tests => 131;
+use Test::More tests => 133;
 
 use RT;
 RT::LoadConfig();
@@ -21,6 +21,9 @@
 $queue->Create( Name => 'RecordCustomFields-'.$$ );
 ok ($queue->id, "Created the queue");
 
+my $queue2 = RT::Queue->new( $RT::SystemUser );
+$queue2->Create( Name => 'RecordCustomFields2' );
+
 my $ticket = RT::Ticket->new( $RT::SystemUser );
 $ticket->Create(
 	Queue => $queue->Id,
@@ -51,6 +54,11 @@
 $global_cf3->AddValue( Name => 'RecordCustomFieldValues31' );
 $global_cf3->AddValue( Name => 'RecordCustomFieldValues32' );
 
+my $local_cf4 = RT::CustomField->new( $RT::SystemUser );
+$local_cf4->Create( Name => 'RecordCustomFields4', Type => 'SelectSingle', Queue => $queue2->id );
+$local_cf4->AddValue( Name => 'RecordCustomFieldValues41' );
+$local_cf4->AddValue( Name => 'RecordCustomFieldValues42' );
+
 
 my @custom_fields = ($local_cf1, $local_cf2, $global_cf3);
 
@@ -178,6 +186,14 @@
 # lets test cycle via CF object reference
 $test_add_delete_cycle->( sub { return $_[0] } );
 
+$ticket->AddCustomFieldValue( Field => $local_cf2->id , Value => 'Baz' );
+$ticket->AddCustomFieldValue( Field => $global_cf3->id , Value => 'Baz' );
+# now if we ask for cf values on RecordCustomFields4 we should not get any
+$cfvs = $ticket->CustomFieldValues( 'RecordCustomFields4' );
+is( $cfvs->Count, 0, "No custom field values for non-Queue cf" );
+is( $ticket->FirstCustomFieldValue( 'RecordCustomFields4' ), undef, "No first custom field value for non-Queue cf" );
+
+
 #SKIP: {
 #	skip "TODO: should we add CF values to objects via CF Name?", 48;
 # names are not unique


More information about the Rt-commit mailing list