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

Alex Vandiver alexmv at bestpractical.com
Thu Mar 29 19:47:27 EDT 2012


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

- Log -----------------------------------------------------------------
commit 2850935684937010e4fa816b1f6723098f64bc7b
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Mar 29 19:45:59 2012 -0400

    Test that binary attachments round-trip
    
    Note that due to a bug in HTTP::Request, this test does not currently pass, for no fault of our own.

diff --git a/t/web/attachments.t b/t/web/attachments.t
index e827b2f..d190460 100644
--- a/t/web/attachments.t
+++ b/t/web/attachments.t
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 use strict;
 
-use RT::Test tests => 14;
+use RT::Test tests => 17;
 
 use constant LogoFile => $RT::MasonComponentRoot .'/NoAuth/images/bplogo.gif';
 use constant FaviconFile => $RT::MasonComponentRoot .'/NoAuth/images/favicon.png';
@@ -30,6 +30,18 @@ $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");
+{
+    local $TODO = "HTTP::Request has a bug which utf8 encodes binary files before upload";
+    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