Merge branch 'patch-5' of https://github.com/gjones2/Freeside (#13854 as this bug...
[freeside.git] / rt / t / mail / gnupg-bad.t
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4
5 use RT::Test::GnuPG
6   tests         => 7,
7   gnupg_options => {
8     passphrase => 'rt-test',
9     homedir => RT::Test::get_abs_relocatable_dir(
10         File::Spec->updir(), qw/data gnupg keyrings/
11     ),
12   };
13
14 RT->Config->Set( 'MailPlugins' => 'Auth::MailFrom', 'Auth::GnuPG' );
15
16 my ($baseurl, $m) = RT::Test->started_ok;
17
18 $m->login;
19 $m->get( $baseurl.'/Admin/Queues/');
20 $m->follow_link_ok( {text => 'General'} );
21 $m->submit_form( form_number => 3,
22          fields      => { CorrespondAddress => 'rt@example.com' } );
23 $m->content_like(qr/rt\@example.com.* - never/, 'has key info.');
24
25 ok(my $user = RT::User->new(RT->SystemUser));
26 ok($user->Load('root'), "Loaded user 'root'");
27 $user->SetEmailAddress('rt@example.com');
28
29 if (0) {
30     # XXX: need to generate these mails
31     diag "no signature";
32     diag "no encryption on encrypted queue";
33     diag "mismatched signature";
34     diag "unknown public key";
35     diag "unknown private key";
36     diag "signer != sender";
37     diag "encryption to user whose pubkey is not signed";
38     diag "no encryption of attachment on encrypted queue";
39     diag "no signature of attachment";
40     diag "revoked key";
41     diag "expired key";
42     diag "unknown algorithm";
43 }
44