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

sartak at bestpractical.com sartak at bestpractical.com
Tue Aug 7 13:30:54 EDT 2007


Author: sartak
Date: Tue Aug  7 13:30:54 2007
New Revision: 8426

Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/   (props changed)
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/mail/gnupg-comprehensive.t

Log:
 r37049 at gorgoroth:  sartak | 2007-08-07 13:30:18 -0400
 Steal more code from t/mail/gnupg-incoming.t


Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/mail/gnupg-comprehensive.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/mail/gnupg-comprehensive.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/mail/gnupg-comprehensive.t	Tue Aug  7 13:30:54 2007
@@ -65,6 +65,52 @@
     print $mailgate $mail;
     RT::Test->close_mailgate_ok($mailgate);
 
+    my $tick = get_latest_ticket_ok();
+    is( $tick->Subject,
+        "Email $id",
+        "Created the ticket"
+    );
+
+    my $txn = $tick->Transactions->First;
+    my ($msg, $attach) = @{$txn->Attachments->ItemsArrayRef};
+
+    if ($usage =~ /encrypted/)
+    {
+        is( $msg->GetHeader('X-RT-Incoming-Encryption'),
+            'Success',
+            'recorded incoming mail that is encrypted'
+        );
+        is( $msg->GetHeader('X-RT-Privacy'),
+            'PGP',
+            'recorded incoming mail that is encrypted'
+        );
+    }
+    else
+    {
+        like(
+            $txn->Attachments->First->Headers,
+            qr/^X-RT-Incoming-Encryption: Not encrypted/m,
+            'recorded incoming mail that is not encrypted'
+        );
+        like( $txn->Attachments->First->Content, qr/!!!/);
+    }
+
+    if ($usage =~ /signed/)
+    {
+    }
+    else
+    {
+    }
+
     return 0;
 }
 
+sub get_latest_ticket_ok {
+    my $tickets = RT::Tickets->new($RT::SystemUser);
+    $tickets->OrderBy( FIELD => 'id', ORDER => 'DESC' );
+    $tickets->Limit( FIELD => 'id', OPERATOR => '>', VALUE => '0' );
+    my $tick = $tickets->First();
+    ok( $tick->Id, "found ticket " . $tick->Id );
+    return $tick;
+}
+


More information about the Rt-commit mailing list