fix ticketing system error on bootstrap of new install
[freeside.git] / rt / t / web / attachment-with-name-0.t
1 use strict;
2 use warnings;
3
4 use RT::Test tests => 8;
5 my ( $baseurl, $m ) = RT::Test->started_ok;
6 ok $m->login, 'logged in as root';
7
8 use File::Spec;
9
10 my $file = File::Spec->catfile( RT::Test->temp_directory, 0 );
11 open my $fh, '>', $file or die $!;
12 print $fh 'foobar';
13 close $fh;
14
15 $m->get_ok( '/Ticket/Create.html?Queue=1' );
16
17 $m->submit_form(
18     form_number => 3,
19     fields => { Subject => 'test att 0', Content => 'test', Attach => $file },
20 );
21 $m->content_like( qr/Ticket \d+ created/i, 'created the ticket' );
22 $m->follow_link_ok( { text => 'Download 0' } );
23 $m->content_contains( 'foobar', 'file content' );