X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Ft%2Fticket%2Fadd-watchers.t;h=12b0bb3e29bc6549dac18fccf2389c352a5c92db;hb=e35f3c4160cbd2cc952411f7fc3ba97a36f61e6d;hp=11b3a845352e15f12816b6c0cd30b12a5124aa6f;hpb=7588a4ac90a9b07c08a3107cd1107d773be1c991;p=freeside.git diff --git a/rt/t/ticket/add-watchers.t b/rt/t/ticket/add-watchers.t index 11b3a8453..12b0bb3e2 100644 --- a/rt/t/ticket/add-watchers.t +++ b/rt/t/ticket/add-watchers.t @@ -1,4 +1,4 @@ -use RT::Test nodata => 1, tests => 32; +use RT::Test nodata => 1, tests => 34; use strict; use warnings; @@ -15,7 +15,7 @@ my $acl = RT::ACL->new(RT->SystemUser); $acl->Limit( FIELD => 'RightName', OPERATOR => '!=', VALUE => 'SuperUser' ); $acl->LimitToObject( RT->System ); while( my $ace = $acl->Next ) { - $ace->Delete; + $ace->Delete; } # create new queue to be sure we do not mess with rights @@ -25,11 +25,12 @@ ok( $queue_id, 'queue created for watcher tests' ); # new privileged user to check rights my $user = RT::User->new( RT->SystemUser ); -my ($user_id) = $user->Create( Name => 'watcher'.$$, - EmailAddress => "watcher$$".'@localhost', - Privileged => 1, - Password => 'qwe123', - ); +my ($user_id) = $user->Create( + Name => 'watcher'.$$, + EmailAddress => "watcher$$".'@localhost', + Privileged => 1, + Password => 'qwe123', +); my $cu= RT::CurrentUser->new($user); # make sure user can see tickets in the queue @@ -86,6 +87,13 @@ ok( $rv, "user can add self as Cc by username" ); ($rv, $msg) = $ticket2->AddWatcher( Type => 'Requestor', Email => $user->Name ); ok( $rv, "user can add self as Requestor by username" ); +# Add an email address with a phrase +($rv, $msg) = $ticket->AddWatcher( Type => 'Cc', Email => q["Foo Bar" ] ); +ok $rv, "Added email address with phrase" or diag $msg; + +my $foo = RT::Test->load_or_create_user( EmailAddress => 'foo@example.com' ); +is $foo->RealName, "Foo Bar", "RealName matches"; + # Queue watcher tests $principal->RevokeRight( Right => 'Watch' , Object => $queue ); ok( !$user->HasRight( Right => 'Watch', Object => $queue ), "user queue watch right revoked" );