X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Ft%2Fapi%2Fattachment_filename.t;h=aa8acd2d9212183c8a89774c55495e2dcf4787c6;hb=f413badbfe4676563d11b528838a21d9ceb8da14;hp=2eced0127021005f476ce69ffddc3ca37486bf8d;hpb=fc6209f398899f0211cfcedeb81a3cd65e04a941;p=freeside.git diff --git a/rt/t/api/attachment_filename.t b/rt/t/api/attachment_filename.t index 2eced0127..aa8acd2d9 100644 --- a/rt/t/api/attachment_filename.t +++ b/rt/t/api/attachment_filename.t @@ -1,6 +1,8 @@ +use strict; +use warnings; use RT::Test tests => 5; use MIME::Entity; -my $ticket = RT::Ticket->new($RT::SystemUser); +my $ticket = RT::Ticket->new(RT->SystemUser); my $mime = MIME::Entity->build( From => 'test@example.com', Type => 'text/html', @@ -8,32 +10,32 @@ my $mime = MIME::Entity->build( ); $mime->attach( - Path => 'share/html/NoAuth/images/bplogo.gif', - Type => 'image/gif', + Path => 'share/static/images/bpslogo.png', + Type => 'image/png', ); $mime->attach( - Path => 'share/html/NoAuth/images/bplogo.gif', - Type => 'image/gif', - Filename => 'bplogo.gif', + Path => 'share/static/images/bpslogo.png', + Type => 'image/png', + Filename => 'bpslogo.png', ); $mime->attach( - Path => 'share/html/NoAuth/images/bplogo.gif', - Filename => 'images/bplogo.gif', - Type => 'image/gif', + Path => 'share/static/images/bpslogo.png', + Filename => 'images/bpslogo.png', + Type => 'image/png', ); my $id = $ticket->Create( MIMEObj => $mime, Queue => 'General' ); ok( $id, "created ticket $id" ); -my $atts = RT::Attachments->new( $RT::SystemUser ); -$atts->Limit( FIELD => 'ContentType', VALUE => 'image/gif' ); -is( $atts->Count, 3, 'got 3 gif files' ); +my $atts = RT::Attachments->new( RT->SystemUser ); +$atts->Limit( FIELD => 'ContentType', VALUE => 'image/png' ); +is( $atts->Count, 3, 'got 3 png files' ); # no matter if mime's filename include path or not, # we should throw away the path all the time. while ( my $att = $atts->Next ) { - is( $att->Filename, 'bplogo.gif', "attachment's filename" ); + is( $att->Filename, 'bpslogo.png', "attachment's filename" ); }