[Rt-commit] r18430 - in rt/3.999/branches/lorzy: lib/RT/Lorzy
clkao at bestpractical.com
clkao at bestpractical.com
Tue Feb 17 10:37:49 EST 2009
Author: clkao
Date: Tue Feb 17 10:37:49 2009
New Revision: 18430
Modified:
rt/3.999/branches/lorzy/lib/RT/Lorzy/Dispatcher.pm
rt/3.999/branches/lorzy/t/lorzy/action.t
Log:
reset rules.
Modified: rt/3.999/branches/lorzy/lib/RT/Lorzy/Dispatcher.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Lorzy/Dispatcher.pm (original)
+++ rt/3.999/branches/lorzy/lib/RT/Lorzy/Dispatcher.pm Tue Feb 17 10:37:49 2009
@@ -4,6 +4,10 @@
my $rules;
+sub reset_rules {
+ $rules = [];
+}
+
sub add_rule {
my ($self, $rule) = @_;
push @$rules, $rule;
Modified: rt/3.999/branches/lorzy/t/lorzy/action.t
==============================================================================
--- rt/3.999/branches/lorzy/t/lorzy/action.t (original)
+++ rt/3.999/branches/lorzy/t/lorzy/action.t Tue Feb 17 10:37:49 2009
@@ -50,18 +50,13 @@
transaction => Lorzy::FunctionArgument->new( name => 'transaction', type => 'RT::Model::Transaction' ) }
);
+RT::Lorzy::Dispatcher->reset_rules;
+
RT::Lorzy::Dispatcher->add_rule(
RT::Lorzy::Rule->new( { condition => $on_created,
action => $auto_reply } )
);
-# remove all existing scrips
-# XXX: disable the builtin lorzy rules here for test once it's enabled by core.
-my $scrips = RT::Model::ScripCollection->new( current_user => RT->system_user);
-$scrips->unlimit;
-$_->delete for @{$scrips};
-
-
my $queue = RT::Model::Queue->new(current_user => RT->system_user);
my ($queue_id) = $queue->create( name => 'lorzy');
ok( $queue_id, 'queue created' );
More information about the Rt-commit
mailing list