[Rt-commit] r9589 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Tue Nov 6 07:08:50 EST 2007


Author: ruz
Date: Tue Nov  6 07:08:48 2007
New Revision: 9589

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/t/web/gnupg-outgoing.t
   rt/branches/3.7-EXPERIMENTAL/t/web/gnupg-select-keys-on-create.t
   rt/branches/3.7-EXPERIMENTAL/t/web/gnupg-select-keys-on-update.t

Log:
 r9370 at cubic-pc (orig r9369):  sartak | 2007-10-20 01:43:21 +0400
  r43896 at onn:  sartak | 2007-10-19 17:43:10 -0400
  Tests for DrySign
 


Modified: rt/branches/3.7-EXPERIMENTAL/t/web/gnupg-outgoing.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/t/web/gnupg-outgoing.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/t/web/gnupg-outgoing.t	Tue Nov  6 07:08:48 2007
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 476;
+use Test::More tests => 492;
 use RT::Test;
 use RT::Action::SendEmail;
 use File::Temp qw(tempdir);
@@ -266,6 +266,9 @@
 
     $m->submit;
     is $m->status, 200, "request successful";
+
+    unlike($m->content, qr/unable to sign outgoing email messages/);
+
     $m->get_ok('/'); # ensure that the mail has been processed
 
     my @mail = RT::Test->fetch_caught_mails;

Modified: rt/branches/3.7-EXPERIMENTAL/t/web/gnupg-select-keys-on-create.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/t/web/gnupg-select-keys-on-create.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/t/web/gnupg-select-keys-on-create.t	Tue Nov  6 07:08:48 2007
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 57;
+use Test::More tests => 60;
 use RT::Test;
 use RT::Action::SendEmail;
 use File::Temp qw(tempdir);
@@ -43,6 +43,25 @@
 my ($baseurl, $m) = RT::Test->started_ok;
 ok $m->login, 'logged in';
 
+diag "check that signing doesn't work if there is no key";
+{
+    unlink "t/mailbox";
+
+    ok $m->goto_create_ticket( $queue ), "UI -> create ticket";
+    $m->form_number(3);
+    $m->tick( Sign => 1 );
+    $m->field( Requestors => 'rt-test at example.com' );
+    $m->field( Content => 'Some content' );
+    $m->submit;
+    $m->content_like(
+        qr/unable to sign outgoing email messages/i,
+        'problems with passphrase'
+    );
+
+    my @mail = RT::Test->fetch_caught_mails;
+    ok !@mail, 'there are no outgoing emails';
+}
+
 {
     RT::Test->import_gnupg_key('rt-recipient at example.com');
     RT::Test->trust_gnupg_key('rt-recipient at example.com');

Modified: rt/branches/3.7-EXPERIMENTAL/t/web/gnupg-select-keys-on-update.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/t/web/gnupg-select-keys-on-update.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL/t/web/gnupg-select-keys-on-update.t	Tue Nov  6 07:08:48 2007
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 64;
+use Test::More tests => 68;
 use RT::Test;
 use RT::Action::SendEmail;
 use File::Temp qw(tempdir);
@@ -43,13 +43,6 @@
 my ($baseurl, $m) = RT::Test->started_ok;
 ok $m->login, 'logged in';
 
-{
-    RT::Test->import_gnupg_key('rt-recipient at example.com');
-    RT::Test->trust_gnupg_key('rt-recipient at example.com');
-    my %res = RT::Crypt::GnuPG::GetKeysInfo('rt-recipient at example.com');
-    is $res{'info'}[0]{'TrustTerse'}, 'ultimate', 'ultimately trusted key';
-}
-
 
 my $tid;
 {
@@ -61,6 +54,33 @@
     ok $tid, 'ticket created';
 }
 
+diag "check that signing doesn't work if there is no key";
+{
+    unlink "t/mailbox";
+
+    ok $m->goto_ticket( $tid ), "UI -> ticket #$tid";
+    $m->follow_link_ok( { text => 'Reply' }, 'ticket -> reply' );
+    $m->form_number(3);
+    $m->tick( Sign => 1 );
+    $m->field( UpdateCc => 'rt-test at example.com' );
+    $m->field( UpdateContent => 'Some content' );
+    $m->click('SubmitTicket');
+    $m->content_like(
+        qr/unable to sign outgoing email messages/i,
+        'problems with passphrase'
+    );
+
+    my @mail = RT::Test->fetch_caught_mails;
+    ok !@mail, 'there are no outgoing emails';
+}
+
+{
+    RT::Test->import_gnupg_key('rt-recipient at example.com');
+    RT::Test->trust_gnupg_key('rt-recipient at example.com');
+    my %res = RT::Crypt::GnuPG::GetKeysInfo('rt-recipient at example.com');
+    is $res{'info'}[0]{'TrustTerse'}, 'ultimate', 'ultimately trusted key';
+}
+
 diag "check that things don't work if there is no key";
 {
     unlink "t/mailbox";


More information about the Rt-commit mailing list