7 passphrase => 'recipient',
8 'trust-model' => 'always',
11 RT::Test->import_gnupg_key( 'recipient@example.com', 'public' );
12 RT::Test->import_gnupg_key( 'general@example.com', 'secret' );
14 ok( my $user = RT::User->new( RT->SystemUser ) );
15 ok( $user->Load('root'), "Loaded user 'root'" );
16 $user->SetEmailAddress('recipient@example.com');
18 my $queue = RT::Test->load_or_create_queue(
20 CorrespondAddress => 'general@example.com',
22 ok $queue && $queue->id, 'loaded or created queue';
25 my ( $baseurl, $m ) = RT::Test->started_ok;
26 ok $m->login, 'logged in';
28 diag "test with Encrypt and Sign disabled";
30 $m->goto_create_ticket($queue);
31 $m->form_name('TicketCreate');
32 $m->field( 'Subject', 'Signing test' );
33 $m->field( 'Content', 'Some other content' );
35 $m->content_like( qr/Ticket \d+ created/i, 'created the ticket' );
36 $m->follow_link_ok( { text => 'with headers' } );
37 $m->content_contains('X-RT-Encrypt: 0');
38 $m->content_contains('X-RT-Sign: 0');
40 diag "test with Encrypt and Sign enabled";
42 $m->goto_create_ticket($queue);
43 $m->form_name('TicketCreate');
44 $m->field( 'Subject', 'Signing test' );
45 $m->field( 'Content', 'Some other content' );
46 $m->tick( 'Encrypt', 1 );
47 $m->tick( 'Sign', 1 );
49 $m->content_like( qr/Ticket \d+ created/i, 'created the ticket' );
50 $m->follow_link_ok( { text => 'with headers' } );
51 $m->content_contains('X-RT-Encrypt: 1');
52 $m->content_contains('X-RT-Sign: 1');