summaryrefslogtreecommitdiff
path: root/rt/t/web/attachments.t
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-09-27 20:27:43 -0700
committerIvan Kohler <ivan@freeside.biz>2012-09-27 20:27:43 -0700
commit3185fe4edea62dd3fa9818cf80902e96fe2a2d21 (patch)
tree824a6cdb4b8ccc163127e00e1e86435b4c523476 /rt/t/web/attachments.t
parentf50a821d306b561d602edbdac0dac958b862ec0c (diff)
parent39533c66139210655fc47404a17fd4e9b9ca8a00 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Conflicts: FS/FS/cust_main/Billing.pm
Diffstat (limited to 'rt/t/web/attachments.t')
-rw-r--r--rt/t/web/attachments.t23
1 files changed, 21 insertions, 2 deletions
diff --git a/rt/t/web/attachments.t b/rt/t/web/attachments.t
index 8c75f6caf..784cbbe88 100644
--- a/rt/t/web/attachments.t
+++ b/rt/t/web/attachments.t
@@ -1,10 +1,11 @@
#!/usr/bin/perl -w
use strict;
-use RT::Test tests => 25;
+use RT::Test tests => 33;
use constant LogoFile => $RT::MasonComponentRoot .'/NoAuth/images/bpslogo.png';
use constant FaviconFile => $RT::MasonComponentRoot .'/NoAuth/images/favicon.png';
+use constant TextFile => $RT::MasonComponentRoot .'/NoAuth/css/print.css';
my ($baseurl, $m) = RT::Test->started_ok;
ok $m->login, 'logged in';
@@ -30,9 +31,18 @@ $m->content_contains('Attachments test', 'we have subject on the page');
$m->content_contains('Some content', 'and content');
$m->content_contains('Download bpslogo.png', 'page has file name');
+open LOGO, "<", LogoFile or die "Can't open logo file: $!";
+binmode LOGO;
+my $logo_contents = do {local $/; <LOGO>};
+close LOGO;
+$m->follow_link_ok({text => "Download bpslogo.png"});
+is($m->content_type, "image/png");
+is($m->content, $logo_contents, "Binary content matches");
+
+$m->back;
$m->follow_link_ok({text => 'Reply'}, "reply to the ticket");
$m->form_name('TicketUpdate');
-$m->field('Attach', LogoFile);
+$m->field('Attach', TextFile);
$m->click('AddMoreAttach');
is($m->status, 200, "request successful");
@@ -44,7 +54,16 @@ is($m->status, 200, "request successful");
$m->content_contains('Download bpslogo.png', 'page has file name');
$m->content_contains('Download favicon.png', 'page has file name');
+$m->content_contains('Download print.css', 'page has file name');
+
+$m->follow_link_ok( { text => 'Download bpslogo.png' } );
+is( $m->response->header('Content-Type'), 'image/png', 'Content-Type of png lacks charset' );
+
+$m->back;
+$m->follow_link_ok( { text => 'Download print.css' } );
+is( $m->response->header('Content-Type'),
+ 'text/css;charset=UTF-8', 'Content-Type of text has charset' );
diag "test mobile ui";
$m->get_ok( $baseurl . '/m/ticket/create?Queue=' . $qid );