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/bplogo.gif',
16 Path => 'share/html/NoAuth/images/bplogo.gif',
18 Filename => 'bplogo.gif',
22 Path => 'share/html/NoAuth/images/bplogo.gif',
23 Filename => 'images/bplogo.gif',
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/gif' );
32 is( $atts->Count, 3, 'got 3 gif 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, 'bplogo.gif', "attachment's filename" );