[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.4-224-g6aef6880de

Jim Brandt jbrandt at bestpractical.com
Fri Jan 22 16:29:31 EST 2021


The branch, 4.4-trunk has been updated
       via  6aef6880de9083b0ed83ee5dd2ba033a9e77ecaa (commit)
       via  cf8d115a9ba7795e29a050d32d5369686e9c6835 (commit)
       via  9cb360f8352b15f733e0998bff4f5e3f2ce3d083 (commit)
       via  1e28eef1981ae4350eefbf31c0348cf6a498dfab (commit)
      from  a661236d645c4693af6de42701883a80ada49de0 (commit)

Summary of changes:
 lib/RT/Action/Notify.pm | 126 ++++++++++++++++++++++++++----------------------
 t/customroles/notify.t  |  48 ++++++++++++++++--
 2 files changed, 112 insertions(+), 62 deletions(-)

- Log -----------------------------------------------------------------
commit 9cb360f8352b15f733e0998bff4f5e3f2ce3d083
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Oct 12 04:41:54 2018 +0800

    Fix typo in test variable name

diff --git a/t/customroles/notify.t b/t/customroles/notify.t
index 98bf1c7f14..770b5b2ed0 100644
--- a/t/customroles/notify.t
+++ b/t/customroles/notify.t
@@ -160,7 +160,7 @@ diag 'create scrips' if $ENV{'TEST_VERBOSE'};
     ok($val, $msg);
 
     my $s3 = RT::Scrip->new(RT->SystemUser);
-    ($val, $msg) = $s2->Create(
+    ($val, $msg) = $s3->Create(
         Queue          => 'Specs',
         ScripCondition => 'On Create',
         ScripAction    => 'Notify Unapplied as Bcc',

commit cf8d115a9ba7795e29a050d32d5369686e9c6835
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Oct 12 04:24:28 2018 +0800

    Test Notify action for custom roles with spaces/commas in name

diff --git a/t/customroles/notify.t b/t/customroles/notify.t
index 770b5b2ed0..19d93c3ecf 100644
--- a/t/customroles/notify.t
+++ b/t/customroles/notify.t
@@ -8,6 +8,8 @@ my $specs = RT::Test->load_or_create_queue( Name => 'Specs' );
 
 my $engineer = RT::CustomRole->new(RT->SystemUser);
 my $sales = RT::CustomRole->new(RT->SystemUser);
+my $designer = RT::CustomRole->new(RT->SystemUser);
+my $pre_sales = RT::CustomRole->new(RT->SystemUser);
 my $unapplied = RT::CustomRole->new(RT->SystemUser);
 
 my $linus = RT::Test->load_or_create_user( EmailAddress => 'linus at example.com' );
@@ -32,6 +34,18 @@ diag 'setup' if $ENV{'TEST_VERBOSE'};
     );
     ok($ok, "created Sales role: $msg");
 
+    ($ok, $msg) = $designer->Create(
+        Name      => 'UX designer',
+        MaxValues => 1,
+    );
+    ok($ok, "created UX designer role: $msg");
+
+    ($ok, $msg) = $pre_sales->Create(
+        Name      => 'Sales, Pre',
+        MaxValues => 0,
+    );
+    ok($ok, "created Sales, Pre role: $msg");
+
     ($ok, $msg) = $unapplied->Create(
         Name      => 'Unapplied',
         MaxValues => 0,
@@ -44,6 +58,12 @@ diag 'setup' if $ENV{'TEST_VERBOSE'};
     ($ok, $msg) = $engineer->AddToObject($specs->id);
     ok($ok, "added Engineer to Specs: $msg");
 
+    ($ok, $msg) = $designer->AddToObject($specs->id);
+    ok($ok, "added UX designer to Specs: $msg");
+
+    ($ok, $msg) = $pre_sales->AddToObject($specs->id);
+    ok($ok, "added Sales, Pre to Specs: $msg");
+
 }
 
 diag 'create tickets in Specs without scrips' if $ENV{'TEST_VERBOSE'};
@@ -138,7 +158,7 @@ diag 'create scrips' if $ENV{'TEST_VERBOSE'};
     ($val, $msg) = $a2->Create(
         Name       => 'Notify Sales as To',
         ExecModule => 'Notify',
-        Argument   => 'RT::CustomRole-2/To',
+        Argument   => 'RT::CustomRole-2/To, "Sales, Pre/Bcc"',
     );
     ok($val, $msg);
 
@@ -167,6 +187,23 @@ diag 'create scrips' if $ENV{'TEST_VERBOSE'};
         Template       => 'Admin Correspondence',
     );
     ok($val, $msg);
+
+    my $a4 = RT::ScripAction->new(RT->SystemUser);
+    ($val, $msg) = $a4->Create(
+        Name       => 'Notify UX Designer as Cc',
+        ExecModule => 'Notify',
+        Argument   => 'UX Designer',
+    );
+    ok($val, $msg);
+
+    my $s4 = RT::Scrip->new(RT->SystemUser);
+    ($val, $msg) = $s4->Create(
+        Queue          => 'Specs',
+        ScripCondition => 'On Create',
+        ScripAction    => 'Notify UX Designer as Cc',
+        Template       => 'Correspondence',
+    );
+    ok($val, $msg);
 }
 
 diag 'create tickets in Specs with scrips' if $ENV{'TEST_VERBOSE'};
@@ -200,9 +237,11 @@ diag 'create tickets in Specs with scrips' if $ENV{'TEST_VERBOSE'};
              Subject              => 'oops',
              Owner                => $ricky,
              $engineer->GroupType => $linus,
+             $designer->GroupType => $moss,
          );
     } { To => $ricky->EmailAddress, Cc => '', Bcc => '' },
-      { To => '', Cc => $linus->EmailAddress, Bcc => '' };
+      { To => '', Cc => $linus->EmailAddress, Bcc => '' },
+      { To => '', Cc => $moss->EmailAddress, Bcc => '' };
 
     mail_ok {
          RT::Test->create_ticket(
@@ -211,10 +250,11 @@ diag 'create tickets in Specs with scrips' if $ENV{'TEST_VERBOSE'};
              Owner                => $ricky,
              $engineer->GroupType => $linus,
              $sales->GroupType    => [$blake->EmailAddress],
+             $pre_sales->GroupType => [$williamson->EmailAddress],
          );
     } { To => $ricky->EmailAddress, Cc => '', Bcc => '' },
       { To => '', Cc => $linus->EmailAddress, Bcc => '' },
-      { To => $blake->EmailAddress, Cc => '', Bcc => '' };
+      { To => $blake->EmailAddress, Cc => '', Bcc => $williamson->EmailAddress };
 
     mail_ok {
          RT::Test->create_ticket(

commit 6aef6880de9083b0ed83ee5dd2ba033a9e77ecaa
Merge: a661236d64 cf8d115a9b
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Jan 22 16:20:44 2021 -0500

    Merge branch '4.4/parse-notify-argument' into 4.4-trunk


-----------------------------------------------------------------------


More information about the rt-commit mailing list