[Bps-public-commit] RT-Extension-SLA branch, ignore-deadline-on-statuses, updated. 0.05_02-4-gda2f26f

Ruslan Zakirov ruz at bestpractical.com
Fri Jun 29 14:07:01 EDT 2012


The branch, ignore-deadline-on-statuses has been updated
       via  da2f26fe9f5ac4156de55db0ccc437ed04ac996e (commit)
       via  8ae6b607fe083c6cb21e23cceab68e55faae5bed (commit)
      from  c5e14573a37fa02da0ec5ccd02e12ca89372e0e4 (commit)

Summary of changes:
 MANIFEST               |    2 ++
 t/ignore-on-statuses.t |   86 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 88 insertions(+)
 create mode 100644 t/ignore-on-statuses.t

- Log -----------------------------------------------------------------
commit 8ae6b607fe083c6cb21e23cceab68e55faae5bed
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Jun 29 21:06:56 2012 +0300

    basic test for IgnoreOnStatuses

diff --git a/t/ignore-on-statuses.t b/t/ignore-on-statuses.t
new file mode 100644
index 0000000..72708f3
--- /dev/null
+++ b/t/ignore-on-statuses.t
@@ -0,0 +1,86 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use RT::Extension::SLA::Test tests => 19;
+
+note 'check that reply to requestors dont unset due date with KeepInLoop';
+{
+    %RT::ServiceAgreements = (
+        Default => '2',
+        Levels => {
+            '2' => {
+                KeepInLoop => { RealMinutes => 60*4, IgnoreOnStatuses => ['stalled'] },
+            },
+        },
+    );
+
+    my $root = RT::User->new( $RT::SystemUser );
+    $root->LoadByEmail('root at localhost');
+    ok $root->id, 'loaded root user';
+
+    # requestor creates
+    my $id;
+    my $due;
+    {
+        my $ticket = RT::Ticket->new( $root );
+        ($id) = $ticket->Create(
+            Queue => 'General',
+            Subject => 'xxx',
+            Requestor => $root->id,
+        );
+        ok $id, "created ticket #$id";
+        is $ticket->FirstCustomFieldValue('SLA'), '2', 'default sla';
+        ok !$ticket->DueObj->Unix, 'no response deadline';
+    }
+
+    # non-requestor reply
+    {
+        my $ticket = RT::Ticket->new( $RT::SystemUser );
+        $ticket->Load( $id );
+        ok $ticket->id, "loaded ticket #$id";
+        $ticket->Correspond( Content => 'we are working on this.' );
+
+        $ticket = RT::Ticket->new( $root );
+        $ticket->Load( $id );
+        ok $ticket->id, "loaded ticket #$id";
+
+        my $tmp = $ticket->DueObj->Unix;
+        ok $tmp > 0, 'Due date is set';
+        ok $tmp > $due, "keep in loop is 4hours when response is 2hours";
+        $due = $tmp;
+    }
+
+    # stalling ticket
+    {
+        my $ticket = RT::Ticket->new( $RT::SystemUser );
+        $ticket->Load( $id );
+        ok $ticket->id, "loaded ticket #$id";
+        my ($status, $msg) = $ticket->SetStatus('stalled');
+        ok $status, 'stalled the ticket';
+
+        $ticket->Load( $id );
+        ok !$ticket->DueObj->Unix, 'keep in loop deadline ignored for stalled';
+    }
+
+    # non-requestor reply again
+    {
+        sleep 1;
+        my $ticket = RT::Ticket->new( $RT::SystemUser );
+        $ticket->Load( $id );
+        ok $ticket->id, "loaded ticket #$id";
+        $ticket->Correspond( Content => 'we are still working on this.' );
+
+        $ticket = RT::Ticket->new( $root );
+        $ticket->Load( $id );
+        ok $ticket->id, "loaded ticket #$id";
+
+        is $ticket->Status, 'open', 'ticket was auto-opened';
+
+        my $tmp = $ticket->DueObj->Unix;
+        ok $tmp > 0, 'Due date is set';
+        ok $tmp > $due, "keep in loop sligtly moved";
+        $due = $tmp;
+    }
+}

commit da2f26fe9f5ac4156de55db0ccc437ed04ac996e
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Jun 29 21:07:33 2012 +0300

    update manifest

diff --git a/MANIFEST b/MANIFEST
index 222021c..28765bf 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,5 +1,6 @@
 Changes
 etc/initialdata
+etc/upgrade/0.06/content
 inc/Module/AutoInstall.pm
 inc/Module/Install.pm
 inc/Module/Install/AutoInstall.pm
@@ -31,6 +32,7 @@ META.yml
 t/basics.t
 t/business_hours.t
 t/due.t
+t/ignore-on-statuses.t
 t/queue.t
 t/starts.t
 t/timezone.t

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



More information about the Bps-public-commit mailing list