4 use RT::Test tests => 2;
6 use constant KIDS => 50;
11 my $t = RT::Ticket->new( RT->SystemUser );
18 diag "Created ticket $id";
19 RT->DatabaseHandle->Disconnect;
23 if (my $pid = fork()) {
28 # In the kid, load up the ticket and correspond
29 RT->ConnectToDatabase;
30 my $t = RT::Ticket->new( RT->SystemUser );
32 $t->Correspond( Content => "Correspondence from PID $$" );
39 waitpid $_, 0 for @kids;
40 diag "All kids finished corresponding";
42 RT->ConnectToDatabase;
43 my $t = RT::Ticket->new( RT->SystemUser );
45 my $txns = $t->Transactions;
46 $txns->Limit( FIELD => 'Type', VALUE => 'Status' );
47 is($txns->Count, 1, "Only one transaction change recorded" );
49 $txns = $t->Transactions;
50 $txns->Limit( FIELD => 'Type', VALUE => 'Correspond' );
51 is($txns->Count, KIDS, "But all correspondences were recorded" );