[Rt-commit] r15930 - in rt/3.8/trunk: t/ticket

sartak at bestpractical.com sartak at bestpractical.com
Thu Sep 11 19:12:54 EDT 2008


Author: sartak
Date: Thu Sep 11 19:12:53 2008
New Revision: 15930

Modified:
   rt/3.8/trunk/   (props changed)
   rt/3.8/trunk/t/ticket/deferred_owner.t

Log:
 r71767 at onn:  sartak | 2008-09-11 19:11:45 -0400
 Catch a warning in t/ticket/deferred_owner


Modified: rt/3.8/trunk/t/ticket/deferred_owner.t
==============================================================================
--- rt/3.8/trunk/t/ticket/deferred_owner.t	(original)
+++ rt/3.8/trunk/t/ticket/deferred_owner.t	Thu Sep 11 19:12:53 2008
@@ -1,4 +1,4 @@
-use Test::More  tests => '17';
+use Test::More tests => 18;
 
 use strict;
 use warnings;
@@ -6,6 +6,7 @@
 use_ok('RT');
 use_ok('RT::Ticket');
 use RT::Test;
+use Test::Warn;
 
 
 my $tester = RT::Test->load_or_create_user(
@@ -98,13 +99,18 @@
           Right => [qw(SeeQueue ShowTicket CreateTicket)],
         },
     );
+
     my $ticket = RT::Ticket->new( $tester );
     # set tester as Cc, Cc role group has right to own and take tickets
-    my ($tid, $txn_id, $msg) = $ticket->Create(
-        Queue => $queue->id,
-        Owner => $tester->id,
-        Cc    => 'tester at localhost',
-    );
+    my ($tid, $txn_id, $msg);
+    warning_like {
+        ($tid, $txn_id, $msg) = $ticket->Create(
+            Queue => $queue->id,
+            Owner => $tester->id,
+            Cc    => 'tester at localhost',
+        );
+    } qr/User .* was proposed as a ticket owner but has no rights to own tickets in General/;
+
     diag $msg if $msg && $ENV{'TEST_VERBOSE'};
     ok $tid, "created a ticket";
     like $ticket->CcAddresses, qr/tester\@localhost/, 'tester is in the cc list';


More information about the Rt-commit mailing list