5 use RT::Test::GnuPG tests => 22, gnupg_options => { passphrase => 'rt-test' };
7 use RT::Action::SendEmail;
9 RT::Test->import_gnupg_key('rt-recipient@example.com');
10 RT::Test->import_gnupg_key('rt-test@example.com', 'public');
12 my $queue = RT::Test->load_or_create_queue(
14 CorrespondAddress => 'rt-recipient@example.com',
15 CommentAddress => 'rt-recipient@example.com',
17 ok $queue && $queue->id, 'loaded or created queue';
19 my ($baseurl, $m) = RT::Test->started_ok;
20 ok $m->login, 'logged in';
26 { Sign => 1, Encrypt => 1 },
34 signed_encrypted => [],
37 diag "check in read-only mode that queue's props influence create/update ticket pages";
39 foreach my $variant ( @variants ) {
40 set_queue_crypt_options( $queue => %$variant );
41 $m->goto_create_ticket( $queue );
42 $m->form_name('TicketCreate');
43 if ( $variant->{'Encrypt'} ) {
44 ok $m->value('Encrypt', 2), "encrypt tick box is checked";
46 ok !$m->value('Encrypt', 2), "encrypt tick box is unchecked";
48 if ( $variant->{'Sign'} ) {
49 ok $m->value('Sign', 2), "sign tick box is checked";
51 ok !$m->value('Sign', 2), "sign tick box is unchecked";
55 # to avoid encryption/signing during create
56 set_queue_crypt_options($queue);
58 my $ticket = RT::Ticket->new( RT->SystemUser );
59 my ($id) = $ticket->Create(
62 Requestor => 'rt-test@example.com',
64 ok $id, 'ticket created';
66 foreach my $variant ( @variants ) {
67 set_queue_crypt_options( $queue => %$variant );
68 $m->get( $m->rt_base_url . "/Ticket/Update.html?Action=Respond&id=$id" );
69 $m->form_name('TicketUpdate');
70 if ( $variant->{'Encrypt'} ) {
71 ok $m->value('Encrypt', 2), "encrypt tick box is checked";
73 ok !$m->value('Encrypt', 2), "encrypt tick box is unchecked";
75 if ( $variant->{'Sign'} ) {
76 ok $m->value('Sign', 2), "sign tick box is checked";
78 ok !$m->value('Sign', 2), "sign tick box is unchecked";