[Rt-commit] rt branch, 3.8/binary-attachment-test, created. rt-3.8.11-17-g6928fac

Alex Vandiver alexmv at bestpractical.com
Mon Apr 2 12:50:49 EDT 2012


The branch, 3.8/binary-attachment-test has been created
        at  6928fac63094935a68438f0d6608cbc351c37cb4 (commit)

- Log -----------------------------------------------------------------
commit 6928fac63094935a68438f0d6608cbc351c37cb4
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Apr 2 12:49:36 2012 -0400

    Add a test to verify binary attachments round-trip

diff --git a/t/web/attachments.t b/t/web/attachments.t
index e827b2f..87b32a7 100644
--- a/t/web/attachments.t
+++ b/t/web/attachments.t
@@ -1,7 +1,8 @@
 #!/usr/bin/perl -w
 use strict;
 
-use RT::Test tests => 14;
+use RT::Test tests => 17;
+$RT::Test::SKIP_REQUEST_WORK_AROUND = 1;
 
 use constant LogoFile => $RT::MasonComponentRoot .'/NoAuth/images/bplogo.gif';
 use constant FaviconFile => $RT::MasonComponentRoot .'/NoAuth/images/favicon.png';
@@ -30,6 +31,15 @@ $m->content_like(qr/Attachments test/, 'we have subject on the page');
 $m->content_like(qr/Some content/, 'and content');
 $m->content_like(qr/Download bplogo\.gif/, 'page has file name');
 
+open LOGO, "<", LogoFile or die "Can't open logo file: $!";
+binmode LOGO;
+my $logo_contents = do {local $/; <LOGO>};
+close LOGO;
+$m->follow_link_ok({text => "Download bplogo.gif"});
+is($m->content_type, "image/gif");
+is($m->content, $logo_contents, "Binary content matches");
+
+$m->back;
 $m->follow_link_ok({text => 'Reply'}, "reply to the ticket");
 $m->form_name('TicketUpdate');
 $m->field('Attach',  LogoFile);

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


More information about the Rt-commit mailing list