summaryrefslogtreecommitdiff
path: root/rt/lib/RT/Test/GnuPG.pm
diff options
context:
space:
mode:
Diffstat (limited to 'rt/lib/RT/Test/GnuPG.pm')
-rw-r--r--rt/lib/RT/Test/GnuPG.pm16
1 files changed, 10 insertions, 6 deletions
diff --git a/rt/lib/RT/Test/GnuPG.pm b/rt/lib/RT/Test/GnuPG.pm
index e5a08b75a..d803399e0 100644
--- a/rt/lib/RT/Test/GnuPG.pm
+++ b/rt/lib/RT/Test/GnuPG.pm
@@ -2,7 +2,7 @@
#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
@@ -64,9 +64,9 @@ sub import {
my %args = @_;
my $t = $class->builder;
- $t->plan( skip_all => 'GnuPG required.' )
+ RT::Test::plan( skip_all => 'GnuPG required.' )
unless GnuPG::Interface->require;
- $t->plan( skip_all => 'gpg executable is required.' )
+ RT::Test::plan( skip_all => 'gpg executable is required.' )
unless RT::Test->find_executable('gpg');
$class->SUPER::import(%args);
@@ -204,13 +204,17 @@ sub check_text_emails {
my $content = $type eq 'email'
? "Some content"
- : "Attachment content";
+ : $args{Attachment};
if ( $args{'Encrypt'} ) {
- unlike $mail, qr/$content/, "outgoing $type was encrypted";
+ unlike $mail, qr/$content/, "outgoing $type is not in plaintext";
+ my $entity = RT::Test::parse_mail($mail);
+ my @res = RT::Crypt->VerifyDecrypt(Entity => $entity);
+ like $res[0]{'status'}, qr/DECRYPTION_OKAY/, "Decrypts OK";
+ like $entity->as_string, qr/$content/, "outgoing decrypts to contain $type content";
} else {
like $mail, qr/$content/, "outgoing $type was not encrypted";
- }
+ }
next unless $type eq 'email';