File: attachment-with-name-0.t

package info (click to toggle)
request-tracker5 5.0.7%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 80,216 kB
  • sloc: javascript: 191,898; perl: 87,146; sh: 1,412; makefile: 487; python: 37; php: 15
file content (24 lines) | stat: -rw-r--r-- 661 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use strict;
use warnings;

use RT::Test tests => 8;
my ( $baseurl, $m ) = RT::Test->started_ok;
ok $m->login, 'logged in as root';

use File::Spec;

my $file = File::Spec->catfile( RT::Test->temp_directory, 0 );
open my $fh, '>', $file or die $!;
print $fh 'foobar';
close $fh;

$m->get_ok( '/Ticket/Create.html?Queue=1' );

$m->submit_form(
    form_number => 3,
    fields => { Subject => 'test att 0', Content => 'test', Attach => $file },
    button => 'SubmitTicket',
);
$m->content_like( qr/Ticket \d+ created/i, 'created the ticket' );
$m->follow_link_ok( { url_regex => qr/Attachment\/\d+\/\d+\/0/ } );
$m->content_contains( 'foobar', 'file content' );