[Rt-commit] rt branch, 4.4/addrolemember-error-handling, created. rt-4.4.1-156-g336059d

Jim Brandt jbrandt at bestpractical.com
Wed Dec 14 13:35:29 EST 2016


The branch, 4.4/addrolemember-error-handling has been created
        at  336059d77e728df0db4ae5f4ac2dc34d475a4dc8 (commit)

- Log -----------------------------------------------------------------
commit 336059d77e728df0db4ae5f4ac2dc34d475a4dc8
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Dec 14 13:33:54 2016 -0500

    Add a test to confirm catching principal check
    
    Add a test to confirm the fix made in a99b56679

diff --git a/t/customroles/role_roles.t b/t/customroles/role_roles.t
new file mode 100644
index 0000000..748d0e1
--- /dev/null
+++ b/t/customroles/role_roles.t
@@ -0,0 +1,45 @@
+use strict;
+use warnings;
+
+use RT::Test tests => undef;
+
+use_ok('RT::Record::Role::Roles');
+
+diag 'Test merging with RT email address as Cc';
+# This confirms we catch errors when trying to assign an email RT
+# owns as a Cc during merge.
+
+my $user_a = RT::Test->load_or_create_user(
+    Name         => 'user_a',
+    Password     => 'password',
+    EmailAddress => 'user_a at example.com',
+);
+ok( $user_a && $user_a->id, 'loaded or created user' );
+
+my ($ticket1) = RT::Test->create_ticket(
+    Queue   => 'General',
+    Subject => 'test subject',
+    Requestor      => 'user_a at example.com',
+);
+
+ok($ticket1->Id, 'Got a new ticket');
+
+my ($ticket2) = RT::Test->create_ticket(
+    Queue   => 'General',
+    Subject => 'test subject',
+    Requestor      => 'user_a at example.com',
+);
+
+ok($ticket2->Id, 'Got another new ticket');
+
+$ticket2->AddWatcher( Type => 'Cc', Email => 'rt at example.com' );
+
+ok(RT::Config->Set('RTAddressRegexp', 'rt at example.com'), 'Set RTAddressRegexp');
+is(RT::Config->Get('RTAddressRegexp'), 'rt at example.com', 'Got back RTAddressRegexp');
+ok(RT::EmailParser->IsRTAddress( 'rt at example.com' ), 'rt at exmaple.com is an RT address');
+
+my ($status,$msg) = $ticket2->MergeInto($ticket1->Id);
+ok( $status, 'Ticket merge ok');
+
+
+done_testing();

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


More information about the rt-commit mailing list