[Rt-commit] r18445 - in rt/3.999/branches/lorzy: bin lib/RT lib/RT/Model t/mail

clkao at bestpractical.com clkao at bestpractical.com
Wed Feb 18 10:07:20 EST 2009


Author: clkao
Date: Wed Feb 18 10:07:19 2009
New Revision: 18445

Modified:
   rt/3.999/branches/lorzy/bin/rt-crontool
   rt/3.999/branches/lorzy/lib/RT/Model/Transaction.pm
   rt/3.999/branches/lorzy/lib/RT/Ruleset.pm
   rt/3.999/branches/lorzy/share/html/Ticket/Update.html
   rt/3.999/branches/lorzy/t/mail/sendmail.t

Log:
various test fixes.


Modified: rt/3.999/branches/lorzy/bin/rt-crontool
==============================================================================
--- rt/3.999/branches/lorzy/bin/rt-crontool	(original)
+++ rt/3.999/branches/lorzy/bin/rt-crontool	Wed Feb 18 10:07:19 2009
@@ -109,7 +109,6 @@
     $template_obj = RT::Model::Template->new( current_user => $CurrentUser );
     $template_obj->load($template_id);
 }
-my $void_scrip = RT::Model::Scrip->new( current_user => $CurrentUser );
 my $void_scrip_action = RT::Model::ScripAction->new( current_user => $CurrentUser );
 
 #At the appointed time:
@@ -159,7 +158,6 @@
         my $condition_obj = $condition->new(
             transaction_obj => $transaction,
             ticket_obj      => $ticket,
-            scrip_obj       => $void_scrip,
             template_obj    => $template_obj,
             argument       => $condition_arg,
             current_user    => $CurrentUser,
@@ -177,7 +175,6 @@
         transaction_obj => $transaction,
         template_obj    => $template_obj,
         argument       => $action_arg,
-        scrip_obj       => $void_scrip,
         scrip_action_obj => $void_scrip_action,
         current_user    => $CurrentUser,
     );

Modified: rt/3.999/branches/lorzy/lib/RT/Model/Transaction.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Model/Transaction.pm	(original)
+++ rt/3.999/branches/lorzy/lib/RT/Model/Transaction.pm	Wed Feb 18 10:07:19 2009
@@ -375,7 +375,7 @@
     Jifty->log->debug( 'About to think about scrips for transaction #' . $self->id );
     if ( $activate_scrips and $args{'object_type'} eq 'RT::Model::Ticket' ) {
         # Entry point of the rule system
-        my $ticket = RT::Model::Ticket->new( current_user => RT->system_user );
+        my $ticket = RT::Model::Ticket->new;
         $ticket->load( $args{'object_id'} );
         my $rules = RT::Ruleset->find_all_rules(
             stage          => 'transaction_create',

Modified: rt/3.999/branches/lorzy/lib/RT/Ruleset.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Ruleset.pm	(original)
+++ rt/3.999/branches/lorzy/lib/RT/Ruleset.pm	Wed Feb 18 10:07:19 2009
@@ -59,9 +59,10 @@
 
 sub find_all_rules {
     my ($class, %args) = @_;
+    my $current_user = $args{ticket_obj}->current_user;
     return [
         grep { $_->prepare }
-        map { $_->new(current_user => RT->system_user, %args) }
+        map { $_->new(current_user => $current_user, %args) }
         grep { $_->_stage eq $args{stage} }
         map { @{$_->rules} } @RULE_SETS
     ];

Modified: rt/3.999/branches/lorzy/share/html/Ticket/Update.html
==============================================================================
--- rt/3.999/branches/lorzy/share/html/Ticket/Update.html	(original)
+++ rt/3.999/branches/lorzy/share/html/Ticket/Update.html	Wed Feb 18 10:07:19 2009
@@ -150,9 +150,10 @@
 
 
 <& /Elements/Submit, label => _('Update Ticket'), name => 'submit_ticket' &>
-% if ($ticket_obj->current_user_has_right('ShowOutgoingEmail')) {
+%# XXX previewscrips disabled for now
+% if (0 && $ticket_obj->current_user_has_right('ShowOutgoingEmail')) {
 <&|/Widgets/TitleBox, title => _('Scrips and Recipients') &>
-<&# /Ticket/Elements/PreviewScrips, ticket_obj => $ticket_obj, %ARGS &>
+<& /Ticket/Elements/PreviewScrips, ticket_obj => $ticket_obj, %ARGS &>
 </&>
 
 % }

Modified: rt/3.999/branches/lorzy/t/mail/sendmail.t
==============================================================================
--- rt/3.999/branches/lorzy/t/mail/sendmail.t	(original)
+++ rt/3.999/branches/lorzy/t/mail/sendmail.t	Wed Feb 18 10:07:19 2009
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 use strict;
-use RT::Test; use Test::More tests => 131;
+use RT::Test; use Test::More tests => 129;
 use File::Spec ();
 
 
@@ -199,9 +199,7 @@
         my $self = shift;
         my $MIME = shift;
 
-        my $scrip = $self->scrip_obj->id;
-        ok(1, $self->scrip_obj->scrip_condition->name . " ".$self->scrip_obj->scrip_action->name);
-        main::_fired_scrip($self->scrip_obj);
+        main::_fired_scrip("#rule");
         $MIME->make_singlepart;
         main::is( ref($MIME) , \'MIME::Entity\',
                   "hey, look. it\'s a mime entity" );
@@ -226,9 +224,7 @@
         my $self = shift;
         my $MIME = shift;
 
-        my $scrip = $self->scrip_obj->id;
-        ok(1, $self->scrip_obj->scrip_condition->name . " ".$self->scrip_obj->scrip_action->name);
-        main::_fired_scrip($self->scrip_obj);
+        main::_fired_scrip("#rule");
         $MIME->make_singlepart;
         main::is( ref($MIME) , \'MIME::Entity\',
                   "hey, look. it\'s a mime entity" );


More information about the Rt-commit mailing list