[Rt-commit] rt branch, 4.4/validator-create-missing-ticket-role-groups, updated. rt-4.4.2-240-gc0a8f5f12
? sunnavy
sunnavy at bestpractical.com
Fri Jun 1 11:28:33 EDT 2018
The branch, 4.4/validator-create-missing-ticket-role-groups has been updated
via c0a8f5f12ec9586c02fe90a939e5ad0d33663cdd (commit)
from f224bddad494f093c90d6f646466f4b6cf9e0db6 (commit)
Summary of changes:
t/validator/role_groups.t | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 t/validator/role_groups.t
- Log -----------------------------------------------------------------
commit c0a8f5f12ec9586c02fe90a939e5ad0d33663cdd
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Jun 1 23:26:44 2018 +0800
Test validator for creating missing role groups
diff --git a/t/validator/role_groups.t b/t/validator/role_groups.t
new file mode 100644
index 000000000..2e4692e4b
--- /dev/null
+++ b/t/validator/role_groups.t
@@ -0,0 +1,28 @@
+use strict;
+use warnings;
+
+use RT::Test tests => undef;
+
+my $ticket = RT::Test->create_ticket( Queue => 'General', Subject => 'test ticket' );
+
+RT::Test->db_is_valid;
+
+$RT::Handle->dbh->do( "DELETE FROM Groups where Domain='RT::Ticket-Role' AND Instance=" . $ticket->id );
+DBIx::SearchBuilder::Record::Cachable->FlushCache;
+
+for my $type ( qw/Requestor AdminCc Cc Owner/ ) {
+ ok( !$ticket->RoleGroup( $type )->id, "Deleted group $type" );
+}
+
+my ( $ecode, $res ) = RT::Test->run_validator( resolve => 1 );
+isnt( $ecode, 0, 'non-zero exit code' );
+
+like( $res, qr/Tickets references a nonexistent record in Groups/, 'Found/Fixed error of Tickets <-> Role Groups' );
+
+RT::Test->db_is_valid;
+
+for my $type ( qw/Requestor AdminCc Cc Owner/ ) {
+ ok( $ticket->RoleGroup( $type )->id, "Recreated group $type" );
+}
+
+done_testing;
-----------------------------------------------------------------------
More information about the rt-commit
mailing list