3 use RT::Test tests => 5;
5 my $ticket = RT::Ticket->new(RT->SystemUser);
6 my $mime = MIME::Entity->build(
7 From => 'test@example.com',
9 Data => ["test attachment's filename\n"],
13 Path => 'share/static/images/bpslogo.png',
18 Path => 'share/static/images/bpslogo.png',
20 Filename => 'bpslogo.png',
24 Path => 'share/static/images/bpslogo.png',
25 Filename => 'images/bpslogo.png',
29 my $id = $ticket->Create( MIMEObj => $mime, Queue => 'General' );
30 ok( $id, "created ticket $id" );
32 my $atts = RT::Attachments->new( RT->SystemUser );
33 $atts->Limit( FIELD => 'ContentType', VALUE => 'image/png' );
34 is( $atts->Count, 3, 'got 3 png files' );
36 # no matter if mime's filename include path or not,
37 # we should throw away the path all the time.
38 while ( my $att = $atts->Next ) {
39 is( $att->Filename, 'bpslogo.png', "attachment's filename" );