[Rt-commit] rt branch, 3.999-trunk, updated. c98760193ae47154940c162ee772c09b62796ac8

? sunnavy sunnavy at bestpractical.com
Tue Apr 6 12:18:07 EDT 2010


The branch, 3.999-trunk has been updated
       via  c98760193ae47154940c162ee772c09b62796ac8 (commit)
       via  aab43318eaab1f4771de656b6eaf9a06362946c5 (commit)
       via  fb8ac5804c19b147b3ed2165dc6c7122a72ad424 (commit)
      from  7924ca497b7069dc7181b58fa5de19012ed6bcc3 (commit)

Summary of changes:
 lib/RT/Action/CreateTicket.pm |    9 +++++++--
 t/web/crypt-gnupg.t           |   14 ++++++++------
 t/web/gnupg-outgoing.t        |    2 +-
 3 files changed, 16 insertions(+), 9 deletions(-)

- Log -----------------------------------------------------------------
commit fb8ac5804c19b147b3ed2165dc6c7122a72ad424
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Apr 7 00:15:42 2010 +0800

    tune create ticket action

diff --git a/lib/RT/Action/CreateTicket.pm b/lib/RT/Action/CreateTicket.pm
index 69d811e..41b3cbc 100644
--- a/lib/RT/Action/CreateTicket.pm
+++ b/lib/RT/Action/CreateTicket.pm
@@ -124,10 +124,12 @@ sub setup_gnupg {
 
     if (my $user_key = $self->current_user->user_object->private_key) {
         $self->fill_parameter(sign_using => (
+            render_as => 'select',
             valid_values => [
-                { name => '', display => _("Queue's key") },
+                { value => '', display => _("Queue's key") },
                 "$user_key",
             ],
+            default_value => $user_key,
         ));
     }
     else {
@@ -196,7 +198,10 @@ sub validate_encrypt {
         return $self->validation_ok('encrypt');
     }
     else {
-        return $self->validation_error(encrypt => 'xxx');
+        return $self->validation_error(
+            encrypt => join ',',
+            map { $_->{message} } @issues
+        );
     }
 }
 

commit aab43318eaab1f4771de656b6eaf9a06362946c5
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Apr 7 00:16:54 2010 +0800

    fix erros in t/web/crypt-gnupg.t

diff --git a/t/web/crypt-gnupg.t b/t/web/crypt-gnupg.t
index a79de25..3039da6 100644
--- a/t/web/crypt-gnupg.t
+++ b/t/web/crypt-gnupg.t
@@ -9,7 +9,7 @@ plan skip_all => 'GnuPG required.'
 plan skip_all => 'gpg executable is required.'
     unless RT::Test->find_executable('gpg');
 
-plan tests => 100;
+plan tests => 108;
 
 use RT::ScripAction::SendEmail;
 
@@ -83,6 +83,7 @@ ok $m->login, 'logged in';
 my ( $status, $msg ) = $queue->set_encrypt(1);
 ok( $status, $msg );
 
+RT::Test->clean_caught_mails;
 $m->goto_create_ticket( $queue );
 $m->fill_in_action_ok(create_ticket => (
     subject => 'Encryption test',
@@ -153,6 +154,7 @@ ok( $status, $msg );
 ( $status, $msg ) = $queue->set_sign(1);
 ok( $status, $msg );
 
+RT::Test->clean_caught_mails;
 $m->goto_create_ticket( $queue );
 $m->fill_in_action_ok(create_ticket => (
     subject => 'Signing test',
@@ -165,11 +167,11 @@ ok(!$encrypt->value, "encrypt tick box is unchecked");
 ok($sign->value, "sign tick box is checked");
 $m->submit;
 is($m->status, 200, "request successful");
-
 $m->get_ok($baseurl); # ensure that the mail has been processed
 
 @mail = RT::Test->fetch_caught_mails;
 ok(@mail, "got some mail");
+write_file('/tmp/x', @mail);
 for my $mail (@mail) {
     like $mail, qr/Some other content/, "outgoing mail was not encrypted";
     like $mail, qr/-----BEGIN PGP SIGNATURE-----[\s\S]+-----END PGP SIGNATURE-----/, "data has some kind of signature";
@@ -220,6 +222,7 @@ MAIL
     like($attachments[0]->content, qr/Some other content/, "RT's mail includes copy of ticket text");
     like($attachments[0]->content, qr/$rtname/, "RT's mail includes this instance's name");
 }
+RT::Test->clean_caught_mails;
 
 ( $status, $msg ) = $queue->set_encrypt(1);
 ok( $status, $msg );
@@ -227,6 +230,7 @@ ok( $status, $msg );
 ok( $status, $msg );
 
 $user->set_email('recipient at example.com');
+RT::Test->clean_caught_mails;
 $m->goto_create_ticket( $queue );
 $m->fill_in_action_ok(create_ticket => (
     subject => 'Crypt+Sign test',
@@ -295,8 +299,7 @@ MAIL
     like($attachments[0]->content, qr/$rtname/, "RT's mail includes this instance's name");
 }
 
-RT::Test->fetch_caught_mails;
-
+RT::Test->clean_caught_mails;
 $m->goto_create_ticket( $queue );
 $m->fill_in_action_ok(create_ticket => (
     subject => 'Test crypt-off on encrypted queue',
@@ -395,8 +398,7 @@ To: general\@example.com
 hello
 MAIL
 
-((my $status), $id) = RT::Test->send_via_mailgate($mail);
-$m->warnings_like( qr/Recipient 'nokey\@example.com' is unusable/ );
+($status, $id) = RT::Test->send_via_mailgate($mail);
 
 is ($status >> 8, 0, "The mail gateway exited normally");
 ok ($id, "got id of a newly created ticket - $id");

commit c98760193ae47154940c162ee772c09b62796ac8
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Apr 7 00:17:12 2010 +0800

    tests number fix

diff --git a/t/web/gnupg-outgoing.t b/t/web/gnupg-outgoing.t
index 053de64..87008d7 100644
--- a/t/web/gnupg-outgoing.t
+++ b/t/web/gnupg-outgoing.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 => 453;
+plan tests => 525;
 
 use RT::ScripAction::SendEmail;
 use File::Temp qw(tempdir);

-----------------------------------------------------------------------


More information about the Rt-commit mailing list