[Rt-commit] rt branch, 4.2/record-attachments-dropping, repushed
? sunnavy
sunnavy at bestpractical.com
Tue Dec 10 04:15:42 EST 2013
The branch 4.2/record-attachments-dropping was deleted and repushed:
was 15b75a8f81cae5e59d2d1240924f9a1e53c080d0
now d6eee84f1d6fc4d462b65fddca3469c090a18144
1: 5f5e8b7 < -: ------- record attachments' dropping/truncation as SystemWarning txn
2: 4efb462 < -: ------- warn log level seems more right for dropping/truncation of attachments
3: c0d937b < -: ------- no need to append .txt if it has .txt already
-: ------- > 1: 0c2b3eb record attachments' dropping/truncation as SystemWarning txn
4: dc344f4 ! 2: d6eee84 test attachment dropping/truncation
@@ -1,6 +1,6 @@
Author: sunnavy <sunnavy at bestpractical.com>
- test attachments dropping/truncation
+ test attachment dropping/truncation
diff --git a/t/web/attachment_dropping.t b/t/web/attachment_dropping.t
new file mode 100644
@@ -11,14 +11,17 @@
+use strict;
+
+use RT::Test tests => 11;
++use Digest::SHA 'sha1_hex';
++use File::Temp 'tempfile';
++
++my $content = 'a' x 1000 . 'b' x 10;
++my ( $fh, $path ) = tempfile( UNLINK => 1, SUFFIX => '.txt' );
++print $fh $content;
++close $fh;
++
++my $name = ( File::Spec->splitpath($path) )[2];
+
+RT->Config->Set( 'MaxAttachmentSize', 1000 );
-+use File::Temp 'tempfile';
-+my ( $fh, $path ) = tempfile( UNLINK => 1, SUFFIX => '.txt' );
-+print $fh 'a' x 1000 . 'b' x 10;
-+close $fh;
-+my $name = ( File::Spec->splitpath($path) )[2];
-+
+RT->Config->Set( 'TruncateLongAttachments', '0' );
+RT->Config->Set( 'DropLongAttachments', '1' );
+
@@ -50,13 +53,16 @@
+use strict;
+
+use RT::Test tests => 12;
-+RT->Config->Set( 'MaxAttachmentSize', 1000 );
++use Digest::SHA 'sha1_hex';
+use File::Temp 'tempfile';
++
++my $content = 'a' x 1000 . 'b' x 10;
+my ( $fh, $path ) = tempfile( UNLINK => 1, SUFFIX => '.txt' );
-+print $fh 'a' x 1000 . 'b' x 10;
++print $fh $content;
+close $fh;
+my $name = ( File::Spec->splitpath($path) )[2];
+
++RT->Config->Set( 'MaxAttachmentSize', 1000 );
+RT->Config->Set( 'TruncateLongAttachments', '1' );
+my ( $baseurl, $m ) = RT::Test->started_ok;
+ok $m->login, 'logged in';
@@ -77,5 +83,3 @@
+$m->follow_link_ok( { text => "Download $name" } );
+$m->content_contains( 'a' x 1000, 'has the first 1000 chars' );
+$m->content_lacks( 'b', 'lacks chars after that' );
-+
-
5: a80a65f < -: ------- record sha1 of dropped/truncated message
6: 9632518 < -: ------- refactor to allow all objects that can _RecordNote
7: 15b75a8 < -: ------- warn if MaxAttachmentSize is set to ridiculously small
More information about the rt-commit
mailing list