[Rt-commit] rt branch, 4.0-trunk, updated. rt-4.0.1-182-ged3fb32

Alex Vandiver alexmv at bestpractical.com
Thu Jul 28 15:16:44 EDT 2011


The branch, 4.0-trunk has been updated
       via  ed3fb32bf2c0168e37b968baf9d31c68c11595d4 (commit)
       via  e9438ff93e30c444f4690d76508585f3128f6aaa (commit)
       via  3642a925478113aab0da7c56b885ca0a39f91aa7 (commit)
       via  38ab255dec8fec923e031d6473d2f436d7aa03b6 (commit)
       via  f889cbb350deda1e20af8be720cc5ebe5a60bfbc (commit)
       via  0f916e34bbede7dcddd5e2b3e341a99faac65bf4 (commit)
       via  6a65e7e6a04dcc0f635be9ad8d060a20a764d536 (commit)
       via  d34fd4b7a7183e48eb61f142480348d4162f5b72 (commit)
       via  ce28b2a95e18362d27c1a1f0336b2fc9c1e0d970 (commit)
       via  11c0d5d840e331e9fb1d3dd48c3d535a83e7666e (commit)
       via  6742ab2bb746ef812f354a9a1eabc0e94861f8f5 (commit)
       via  cfd2128fd386398119f29b524cf3662835410806 (commit)
       via  8364064ffc7f942add6f4c886e87acadf14f5c32 (commit)
       via  486379c6c24c31e381b62c36ecd141861a748a42 (commit)
       via  9a57f9584dab85bedd440c980c5128cdcb989503 (commit)
       via  7854511b23e35d28d118a59b7c3d8985a76cd607 (commit)
      from  e712769e74a02ff9baff5ce86e1be0b4dddca549 (commit)

Summary of changes:
 lib/RT/Attachment.pm                             |   45 +++++++-
 lib/RT/Interface/Email.pm                        |   11 +-
 lib/RT/Transaction.pm                            |   51 +++------
 {share/html/NoAuth/images => t/data}/bpslogo.png |  Bin 3929 -> 3929 bytes
 t/mail/rfc822-attachment.t                       |  139 +++++++++++++++++++++
 t/web/ticket_forward.t                           |  143 +++++++++++++++++++++-
 6 files changed, 339 insertions(+), 50 deletions(-)
 copy {share/html/NoAuth/images => t/data}/bpslogo.png (100%)
 create mode 100644 t/mail/rfc822-attachment.t

- Log -----------------------------------------------------------------
commit ed3fb32bf2c0168e37b968baf9d31c68c11595d4
Merge: e712769 e9438ff
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Jul 28 15:06:06 2011 -0400

    Merge branch '4.0/rfc822-attachment' into 4.0-trunk
    
    Conflicts:
    	t/web/ticket_forward.t

diff --cc t/web/ticket_forward.t
index 6a4bb2c,4fd3e91..c8205be
--- a/t/web/ticket_forward.t
+++ b/t/web/ticket_forward.t
@@@ -95,6 -95,139 +95,139 @@@ diag "Forward Ticket without content" i
          fields    => { To => 'rt-test at example.com', },
          button    => 'ForwardAndReturn'
      );
 -    $m->content_contains( 'Send email successfully', 'sent mail msg' );
 +    $m->content_contains( 'Sent email successfully', 'sent mail msg' );
+     my ($mail) = RT::Test->fetch_caught_mails;
+     like( $mail, qr/Subject: Fwd: \[example\.com #\d\] test forward without content/, 'Subject field' );
+     like( $mail, qr/To: rt-test\@example\.com/,             'To field' );
+     like( $mail, qr/This is a forward of ticket #\d/,       'content' );
+ }
+ 
+ diag "Forward Transaction with attachments but empty content" if $ENV{TEST_VERBOSE};
+ {
+     # Create a ticket without content but with a non-text/plain attachment
+     $m->get_ok( $baseurl . '/Ticket/Create.html?Queue=1' );
+ 
+     $m->form_name('TicketCreate');
+     my $attach = $m->current_form->find_input('Attach');
+     $attach->filename("awesome.patch");
+     $attach->headers('Content-Type' => 'text/x-diff');
+     $m->set_fields(
+         Subject => 'test forward, empty content but attachments',
+         Attach  => $att_file, # from up top
+     );
+     $m->click('AddMoreAttach');
+     $m->form_name('TicketCreate');
+     $attach = $m->current_form->find_input('Attach');
+     $attach->filename("bpslogo.png");
+     $attach->headers('Content-Type' => 'image/png');
+     $m->set_fields(
+         Attach  => RT::Test::get_relocatable_file('bpslogo.png', '..', 'data'), # an image!
+     );
+     $m->submit;
+     $m->content_like( qr/Ticket \d+ created/i, 'created the ticket' );
+     $m->content_like( qr/awesome\.patch/,   'uploaded patch file' );
+     $m->content_like( qr/text\/x-diff/,     'uploaded patch file content type' );
+     $m->content_like( qr/bpslogo\.png/,     'uploaded image file' );
+     $m->content_like( qr/image\/png/,       'uploaded image file content type' );
+     RT::Test->clean_caught_mails;
+ 
+     $m->follow_link_ok( { text => 'Forward', n => 2 }, 'follow 2nd Forward' );
+     $m->submit_form(
+         form_name => 'ForwardMessage',
+         fields    => {
+             To  => 'rt-test at example.com',
+         },
+         button => 'ForwardAndReturn'
+     );
 -    $m->content_contains( 'Send email successfully', 'sent mail msg' );
++    $m->content_contains( 'Sent email successfully', 'sent mail msg' );
+     $m->content_like( qr/Forwarded Transaction #\d+ to rt-test\@example\.com/, 'txn msg' );
+     my ($mail) = RT::Test->fetch_caught_mails;
+     like( $mail, qr/Subject: test forward, empty content but attachments/, 'Subject field' );
+     like( $mail, qr/To: rt-test\@example.com/,         'To field' );
+     like( $mail, qr/This is a forward of transaction/, 'content' );
+     like( $mail, qr/awesome\.patch/,                   'att file name' );
+     like( $mail, qr/this is an attachment/,            'att content' );
+     like( $mail, qr/text\/x-diff/,                     'att content type' );
+     like( $mail, qr/bpslogo\.png/,                     'att image file name' );
+     like( $mail, qr/image\/png/,                       'att image content type' );
+ }
+ 
+ diag "Forward Transaction with attachments but no 'content' part" if $ENV{TEST_VERBOSE};
+ {
+     my $mime = MIME::Entity->build(
+         From    => 'test at example.com',
+         Subject => 'attachments for everyone',
+         Type    => 'multipart/mixed',
+     );
+ 
+     $mime->attach(
+         Path        => $att_file,
+         Type        => 'text/x-diff',
+         Filename    => 'awesome.patch',
+         Disposition => 'attachment',
+     );
+     
+     $mime->attach(
+         Path        => RT::Test::get_relocatable_file('bpslogo.png', '..', 'data'),
+         Type        => 'image/png',
+         Filename    => 'bpslogo.png',
+         Encoding    => 'base64',
+         Disposition => 'attachment',
+     );
+ 
+     my $ticket = RT::Test->create_ticket(
+         Queue   => 1,
+         Subject => 'test forward, attachments but no "content"',
+         MIMEObj => $mime,
+     );
+ 
+     $m->get_ok( $baseurl . '/Ticket/Display.html?id=' . $ticket->Id );
+     $m->content_like( qr/awesome\.patch/,   'uploaded patch file' );
+     $m->content_like( qr/text\/x-diff/,     'uploaded patch file content type' );
+     $m->content_like( qr/bpslogo\.png/,     'uploaded image file' );
+     $m->content_like( qr/image\/png/,       'uploaded image file content type' );
+     RT::Test->clean_caught_mails;
+ 
+     # Forward txn
+     $m->follow_link_ok( { text => 'Forward', n => 2 }, 'follow 2nd Forward' );
+     $m->submit_form(
+         form_name => 'ForwardMessage',
+         fields    => {
+             To  => 'rt-test at example.com',
+         },
+         button => 'ForwardAndReturn'
+     );
 -    $m->content_contains( 'Send email successfully', 'sent mail msg' );
++    $m->content_contains( 'Sent email successfully', 'sent mail msg' );
+     $m->content_like( qr/Forwarded Transaction #\d+ to rt-test\@example\.com/, 'txn msg' );
+     
+     # Forward ticket
+     $m->follow_link_ok( { text => 'Forward', n => 1 }, 'follow 1st Forward' );
+     $m->submit_form(
+         form_name => 'ForwardMessage',
+         fields    => {
+             To  => 'rt-test at example.com',
+         },
+         button => 'ForwardAndReturn'
+     );
 -    $m->content_contains( 'Send email successfully', 'sent mail msg' );
++    $m->content_contains( 'Sent email successfully', 'sent mail msg' );
+     $m->content_like( qr/Forwarded Ticket to rt-test\@example\.com/, 'txn msg' );
+ 
+     my ($forward_txn, $forward_ticket) = RT::Test->fetch_caught_mails;
+     my $tag = qr/Fwd: \[example\.com #\d+\]/;
+     like( $forward_txn, qr/Subject: $tag attachments for everyone/, 'Subject field is from txn' );
+     like( $forward_txn, qr/This is a forward of transaction/, 'forward description' );
+     like( $forward_ticket, qr/Subject: $tag test forward, attachments but no "content"/, 'Subject field is from ticket' );
+     like( $forward_ticket, qr/This is a forward of ticket/, 'forward description' );
+ 
+     for my $mail ($forward_txn, $forward_ticket) {
+         like( $mail, qr/To: rt-test\@example.com/,         'To field' );
+         like( $mail, qr/awesome\.patch/,                   'att file name' );
+         like( $mail, qr/this is an attachment/,            'att content' );
+         like( $mail, qr/text\/x-diff/,                     'att content type' );
+         like( $mail, qr/bpslogo\.png/,                     'att image file name' );
+         like( $mail, qr/image\/png/,                       'att image content type' );
+     }
  }
  
+ undef $m;
+ done_testing;

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


More information about the Rt-commit mailing list