[Rt-commit] r3080 - RT-Action-ExtractSubjectTag/t
kevinr at bestpractical.com
kevinr at bestpractical.com
Tue Jun 7 18:11:34 EDT 2005
Author: kevinr
Date: Tue Jun 7 18:11:34 2005
New Revision: 3080
Modified:
/ (props changed)
RT-Action-ExtractSubjectTag/t/01extract_tags.t
Log:
r4003 at SAD-GIRL-IN-SNOW: kevinr | 2005-06-07 13:44:19 -0400
* added tests for action and scrip creation
Modified: RT-Action-ExtractSubjectTag/t/01extract_tags.t
==============================================================================
--- RT-Action-ExtractSubjectTag/t/01extract_tags.t (original)
+++ RT-Action-ExtractSubjectTag/t/01extract_tags.t Tue Jun 7 18:11:34 2005
@@ -2,6 +2,7 @@
use strict;
use Test::More qw/no_plan/;
+#use Test::More tests => 3;
use RT;
RT::LoadConfig();
RT::Init;
@@ -24,16 +25,30 @@
# to start with since it succeeds :)
is (__PACKAGE__, 'main', "We're operating in the main package");
-# test default action (extract other RT instances' tags)
+my ($id, $message);
-my $default_action = RT::ScripAction->new($RT::SystemUser);
+### test default action (extract other RT instances' tags) ###
-$default_action->Create( Name => 'ExtractSubjectTag (default)',
- Description => '',
- ExecModule => 'ExtractSubjectTag',
- );
-
-ok ($default_action->Name eq 'ExtractSubjectTag (default)', 'Module loads');
+# add the action to the database
+my $action = RT::ScripAction->new($RT::SystemUser);
+($id, $message) = $action->Create( Name => 'ExtractSubjectTag',
+ Description => '',
+ ExecModule => 'ExtractSubjectTag',
+ );
+ok ($id, "create action? " . $message);
+
+# add the scrip to the database
+
+my $scrip = RT::Scrip->new($RT::SystemUser);
+($id, $message) = $scrip->Create( Description => 'OnTransactionExtractSubjectTag',
+ Queue => 0,
+ ScripCondition => 'On Transaction',
+ ScripAction => 'ExtractSubjectTag',
+ Template => 'Blank',
+ Stage => 'TransactionCreate',
+ );
+#ok ($scrip->Description eq 'OnTransactionExtractSubjectTag', 'can create scrip');
+ok ($id, "create scrip? " . $message);
1;
More information about the Rt-commit
mailing list