[Rt-commit] rt branch, 4.2/fixup-default-scrips, updated. rt-4.1.8-559-g1c54746

Thomas Sibley trs at bestpractical.com
Tue Jun 18 20:57:06 EDT 2013


The branch, 4.2/fixup-default-scrips has been updated
       via  1c54746e793f0ba12bffeffb4e509ebbc1d90319 (commit)
      from  2929fa6af8283104c50d3acaeec636593d2a5e99 (commit)

Summary of changes:
 etc/initialdata    |  6 ++++++
 t/approval/basic.t | 18 ++++++++++++++++--
 2 files changed, 22 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 1c54746e793f0ba12bffeffb4e509ebbc1d90319
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Jun 18 17:51:28 2013 -0700

    Suppress duplicate create notifications in the ___Approvals queue
    
    Approval tests caught the duplicate notifications which occur via the
    new owner on create scrip + existing NewPending rule.  Until rules are
    replaced by appropriate scrips, squash duplicates by suppressing the
    scrip's notification via an empty template.  AdminCcs always received
    duplicate notifications via the same scrip (before it also included
    Owner), and they are now fixed as well (for new installs).
    
    Tests also needed adjustment for the extra notifications sent to Owners
    on correspond, but these are expected.

diff --git a/etc/initialdata b/etc/initialdata
index bbccab5..061a68c 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -317,6 +317,12 @@ Content-Type: text/html
 {$Transaction->Content( Type => "text/html")}
 '
     },
+    # Shadow the global template of the same name to suppress duplicate
+    # notifications until rules is ripped out.
+    { Queue     => "___Approvals",
+      Name      => "Transaction in HTML",
+      Content   => "",
+    },
     {
 
       Queue       => '0',
diff --git a/t/approval/basic.t b/t/approval/basic.t
index 45b0313..0e88b74 100644
--- a/t/approval/basic.t
+++ b/t/approval/basic.t
@@ -4,7 +4,6 @@ use RT::Test tests => undef;
 BEGIN {
     plan skip_all => 'Email::Abstract and Test::Email required.'
         unless eval { require Email::Abstract; require Test::Email; 1 };
-    plan tests => 38;
 }
 
 use RT::Test::Email;
@@ -88,6 +87,9 @@ mail_ok {
     to => 'minion at company.com',
     subject => qr/PO for stationary/,
     body => qr/automatically generated in response/
+},{ from => qr/RT System/,
+    to => 'root at localhost',
+    subject => qr/PO for stationary/,
 }, { from => qr/RT System/,
     to => 'cfo at company.com',
     subject => qr/New Pending Approval: CFO Approval/,
@@ -135,6 +137,9 @@ mail_ok {
     subject => qr/New Pending Approval: PO approval request for PO/,
     body => qr/pending your approval.*CFO approved.*ok with that\?/s
 },{ from => qr/RT System/,
+    to => 'root at localhost',
+    subject => qr/Ticket Approved:/,
+},{ from => qr/RT System/,
     to => 'minion at company.com',
     subject => qr/Ticket Approved:/,
     body => qr/approved by CFO.*notes: Resources exist to be consumed/s
@@ -163,10 +168,14 @@ mail_ok {
     ok($ok, "ceo can approve - $msg");
 
 } { from => qr/RT System/,
+    to => 'root at localhost',
+    subject => qr/Ticket Approved:/,
+    body => qr/approved by CEO.*Its Owner may now start to act on it.*notes: And consumed they will be/s,
+},{ from => qr/RT System/,
     to => 'minion at company.com',
     subject => qr/Ticket Approved:/,
     body => qr/approved by CEO.*Its Owner may now start to act on it.*notes: And consumed they will be/s,
-}, { from => qr/CEO via RT/,
+},{ from => qr/CEO via RT/,
      to => 'root at localhost',
      subject => qr/Ticket Approved/,
      body => qr/The ticket has been approved, you may now start to act on it/,
@@ -201,6 +210,10 @@ mail_ok {
     ok($ok, "cfo can approve - $msg");
 
 } { from => qr/RT System/,
+    to => 'root at localhost',
+    subject => qr/Ticket Rejected: PO for stationary/,
+    body => qr/rejected by CFO.*out of resources/s,
+},{ from => qr/RT System/,
     to => 'minion at company.com',
     subject => qr/Ticket Rejected: PO for stationary/,
     body => qr/rejected by CFO.*out of resources/s,
@@ -210,3 +223,4 @@ $t->Load($t->id);$dependson_ceo->Load($dependson_ceo->id);
 is_deeply([ $t->Status, $dependson_cfo->Status, $dependson_ceo->Status ],
           [ 'rejected', 'rejected', 'deleted'], 'ticket state after cfo rejection');
 
+done_testing;

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


More information about the Rt-commit mailing list