[Rt-commit] rt branch, 4.2/shredder-watcher-history, created. rt-4.0.8-803-g4a2af22
Alex Vandiver
alexmv at bestpractical.com
Mon Dec 3 16:50:34 EST 2012
The branch, 4.2/shredder-watcher-history has been created
at 4a2af22111aa35ab878c14501c0ed54821929f27 (commit)
- Log -----------------------------------------------------------------
commit 4a2af22111aa35ab878c14501c0ed54821929f27
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Mon Dec 3 16:50:15 2012 -0500
Add a TODO'd test for watcher transactions when users are shredded
diff --git a/t/shredder/02group_member.t b/t/shredder/02group_member.t
index 4170c94..0208078 100644
--- a/t/shredder/02group_member.t
+++ b/t/shredder/02group_member.t
@@ -3,7 +3,7 @@ use strict;
use warnings;
use Test::Deep;
-use RT::Test::Shredder tests => 26;
+use RT::Test::Shredder tests => 34;
my $test = "RT::Test::Shredder";
### nested membership check
@@ -55,6 +55,48 @@ my $test = "RT::Test::Shredder";
cmp_deeply( $test->dump_current_and_savepoint('clean'), "current DB equal to savepoint");
}
+### deleting member of the ticket AdminCc role group
+{
+ $test->restore_savepoint('clean');
+
+ my $user = RT::User->new( RT->SystemUser );
+ my ($uid, $msg) = $user->Create( Name => 'new user', Privileged => 1, Disabled => 0 );
+ ok( $uid, "created new user" ) or diag "error: $msg";
+ is( $user->id, $uid, "id is correct" );
+
+ use RT::Queue;
+ my $queue = RT::Queue->new( RT->SystemUser );
+ $queue->Load('general');
+ ok( $queue->id, "queue loaded succesfully" );
+
+ $user->PrincipalObj->GrantRight( Right => 'WatchAsAcminCc', Object => $queue );
+
+ use RT::Tickets;
+ my $ticket = RT::Ticket->new( RT->SystemUser );
+ my ($id) = $ticket->Create( Subject => 'test', Queue => $queue->id );
+ ok( $id, "created new ticket" );
+ $ticket = RT::Ticket->new( RT->SystemUser );
+ my $status;
+ ($status, $msg) = $ticket->Load( $id );
+ ok( $id, "load ticket" ) or diag( "error: $msg" );
+
+ ($status, $msg) = $ticket->AddWatcher( Type => "AdminCc", PrincipalId => $user->id );
+ ok( $status, "AdminCC successfuly added") or diag( "error: $msg" );
+
+ my $member = $ticket->AdminCc->MembersObj->First;
+ my $shredder = $test->shredder_new();
+ $shredder->PutObjects( Objects => $member );
+ $shredder->WipeoutAll();
+ $test->db_is_valid;
+
+ $shredder->PutObjects( Objects => $user );
+ $shredder->WipeoutAll();
+ TODO: {
+ local $TODO = "AddWatcher/DelWatcher records not removed";
+ $test->db_is_valid;
+ }
+}
+
### deleting member of the ticket Owner role group
{
$test->restore_savepoint('clean');
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list