
clkao at bestpractical
Nov 4, 2009, 7:14 AM
Post #1 of 1
(81 views)
Permalink
|
|
rt branch, 3.999-trunk, updated. 98202add57141cb3323c9c4ecdbc8608b0f9a651
|
|
The branch, 3.999-trunk has been updated via 98202add57141cb3323c9c4ecdbc8608b0f9a651 (commit) via 6c157012e178e0a2f877c77d08f155ab39f73834 (commit) from 4573b44f6388b846af1e8d7ca684619608efd458 (commit) Summary of changes: t/mail/gnupg-reverification.t | 18 ++++++++---------- 1 files changed, 8 insertions(+), 10 deletions(-) - Log ----------------------------------------------------------------- commit 6c157012e178e0a2f877c77d08f155ab39f73834 Author: Chia-liang Kao <clkao[at]bestpractical.com> Date: Wed Nov 4 21:56:08 2009 +0800 cleanup RT::Test::Email usage. diff --git a/t/mail/gnupg-reverification.t b/t/mail/gnupg-reverification.t index b6529a1..45b4b96 100644 --- a/t/mail/gnupg-reverification.t +++ b/t/mail/gnupg-reverification.t @@ -3,6 +3,8 @@ use strict; use warnings; use RT::Test; +use RT::Test::Email; + plan skip_all => 'GnuPG required.' unless eval 'use GnuPG::Interface; 1'; plan skip_all => 'gpg executable is required.' @@ -53,11 +55,6 @@ RT::Test->set_rights( my ($baseurl, $m) = RT::Test->started_ok; ok $m->login, 'we get log in'; -use RT::Test::Email; - -#no strict 'refs'; -#*mail_ok = *RT::Test::Email::mail_ok; -RT::Test->set_mail_catcher; RT::Test->import_gnupg_key('rt-recipient[at]example.com'); commit 98202add57141cb3323c9c4ecdbc8608b0f9a651 Author: Chia-liang Kao <clkao[at]bestpractical.com> Date: Wed Nov 4 22:58:28 2009 +0800 Expect warnings. diff --git a/t/mail/gnupg-reverification.t b/t/mail/gnupg-reverification.t index 45b4b96..7d71e67 100644 --- a/t/mail/gnupg-reverification.t +++ b/t/mail/gnupg-reverification.t @@ -10,7 +10,7 @@ plan skip_all => 'GnuPG required.' plan skip_all => 'gpg executable is required.' unless RT::Test->find_executable('gpg'); -plan tests => 147; +plan tests => 159; # the test imports a bunch of signed email but not loading the public # keys into the server first. We then check if the message can be @@ -70,9 +70,8 @@ foreach my $file ( @files ) { my $email_content = RT::Test->file_content( $file ); ok $email_content, "$eid: got content of email"; my ($from) = $email_content =~ m/^From: .*?(.*)$/mg; - my ($addr) = Email::Address->parse( $from ); - diag "testing $file from ".$addr->address if $ENV{'TEST_VERBOSE'}; - + my ($addr) = map { $_->address } Email::Address->parse( $from ); + diag "testing $file from ".$addr if $ENV{'TEST_VERBOSE'}; my ($status, $id); mail_ok { # XXX: also expect an error from server saying no pubkey. @@ -80,7 +79,7 @@ foreach my $file ( @files ) { is $status >> 8, 0, "$eid: the mail gateway exited normally"; ok $id, "$eid: got id of a newly created ticket - $id"; } { - to => $addr->address, + to => $addr, subject => qr/We do not have your public key/, body => qr/we do not have your public PGP key/, }, { @@ -101,6 +100,8 @@ foreach my $file ( @files ) { ); $m->content_like(qr/This is .*ID:$eid/ims, "$eid: content is there and message is decrypted"); + $m->warnings_like(qr/Recipient '\Q$addr\E' is unusable/); + push @ticket_ids, $id; } ----------------------------------------------------------------------- _______________________________________________ Rt-commit mailing list Rt-commit[at]lists.bestpractical.com http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-commit
|