1 use RT::Test tests => 5;
3 my $ticket = RT::Ticket->new(RT->SystemUser);
4 my $mime = MIME::Entity->build(
5 From => 'test@example.com',
7 Data => ["test attachment's filename\n"],
11 Path => 'share/html/NoAuth/images/bpslogo.png',
16 Path => 'share/html/NoAuth/images/bpslogo.png',
18 Filename => 'bpslogo.png',
22 Path => 'share/html/NoAuth/images/bpslogo.png',
23 Filename => 'images/bpslogo.png',
27 my $id = $ticket->Create( MIMEObj => $mime, Queue => 'General' );
28 ok( $id, "created ticket $id" );
30 my $atts = RT::Attachments->new( RT->SystemUser );
31 $atts->Limit( FIELD => 'ContentType', VALUE => 'image/png' );
32 is( $atts->Count, 3, 'got 3 png files' );
34 # no matter if mime's filename include path or not,
35 # we should throw away the path all the time.
36 while ( my $att = $atts->Next ) {
37 is( $att->Filename, 'bpslogo.png', "attachment's filename" );