[Rt-commit] r15551 - in rt/branches/3.999-DANGEROUS: .

sunnavy at bestpractical.com sunnavy at bestpractical.com
Wed Aug 27 14:00:32 EDT 2008


Author: sunnavy
Date: Wed Aug 27 14:00:31 2008
New Revision: 15551

Modified:
   rt/branches/3.999-DANGEROUS/   (props changed)
   rt/branches/3.999-DANGEROUS/t/ticket/action_linear_escalate.t

Log:
 r16162 at sunnavys-mb:  sunnavy | 2008-08-28 01:48:46 +0800
 $ticket->last_updated_by returns user object instead of just the id; also name fix


Modified: rt/branches/3.999-DANGEROUS/t/ticket/action_linear_escalate.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/action_linear_escalate.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/action_linear_escalate.t	Wed Aug 27 14:00:31 2008
@@ -35,29 +35,29 @@
 ok $user && $user->id, 'loaded or created user';
 
 $user->principal_object->grant_right( right => 'SuperUser' );
-my $current_user = RT::CurrentUser->new( id => RT->system_user->id );
-is( $id, $current_user->id, "Got current user?" );
+my $current_user = RT::CurrentUser->new( id => $user->id );
+is( $user->id, $current_user->id, "Got current user?" );
 
 #defaults
 $RecordTransaction = 0;
 $UpdateLastUpdated = 1;
 my $ticket2 = create_ticket_as_ok($current_user);
 escalate_ticket_ok($ticket2);
-ok( $ticket2->last_updated_by != $user->id, "Set LastUpdated" );
+ok( $ticket2->last_updated_by->id != $user->id, "Set LastUpdated" );
 ok( $ticket2->transactions->last->type =~ /Create/i, "Did not record a transaction" );
 
 $RecordTransaction = 1;
 $UpdateLastUpdated = 1;
 my $ticket1 = create_ticket_as_ok($current_user);
 escalate_ticket_ok($ticket1);
-ok( $ticket1->last_updated_by != $user->id, "Set LastUpdated" );
+ok( $ticket1->last_updated_by->id != $user->id, "Set LastUpdated" );
 ok( $ticket1->transactions->last->type !~ /Create/i, "Recorded a transaction" );
 
 $RecordTransaction = 0;
 $UpdateLastUpdated = 0;
 my $ticket3 = create_ticket_as_ok($current_user);
 escalate_ticket_ok($ticket3);
-ok( $ticket3->last_updated_by == $user->id, "Did not set LastUpdated" );
+ok( $ticket3->last_updated_by->id == $user->id, "Did not set LastUpdated" );
 ok( $ticket3->transactions->last->type =~ /Create/i, "Did not record a transaction" );
 
 1;
@@ -79,10 +79,10 @@
                                    final_priority => 50,
                                  );
     ok($id, "Created ticket? ".$id);
-    $ticket->__set( field => 'Created',
+    $ticket->__set( column => 'created',
                     value => $created->iso,
                   );
-    $ticket->__set( field => 'Due',
+    $ticket->__set( column => 'due',
                     value => $due->iso,
                   );
 
@@ -95,6 +95,7 @@
     print "$RT::BinPath/rt-crontool --search RT::Search::FromSQL --search-arg \"id = @{[$id]}\" --action RT::ScripAction::LinearEscalate --action-arg \"RecordTransaction:$RecordTransaction; UpdateLastUpdated:$UpdateLastUpdated\"\n";
     print STDERR `$RT::BinPath/rt-crontool --search RT::Search::FromSQL --search-arg "id = @{[$id]}" --action RT::ScripAction::LinearEscalate --action-arg "RecordTransaction:$RecordTransaction; UpdateLastUpdated:$UpdateLastUpdated"`;
 
+    Jifty::DBI::Record::Cachable->flush_cache;
     $ticket->load($id);     # reload, because otherwise we get the cached value
     ok( $ticket->priority != 0, "Escalated ticket" );
 }


More information about the Rt-commit mailing list