File: image.t

package info (click to toggle)
libmojomojo-perl 1.12%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,524 kB
  • sloc: perl: 14,730; xml: 120; sh: 97; makefile: 8; ruby: 6
file content (14 lines) | stat: -rw-r--r-- 514 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/perl
use Test::More tests => 4;
BEGIN{
    $ENV{CATALYST_CONFIG} = 't/var/mojomojo.yml';
};
use_ok( Catalyst::Test, 'MojoMojo' );

my ( $res, $c ) = ctx_request('/');
$c->config->{'Formatter::Dir'}{whitelisting} = 't/var/files';
$c->config->{'Formatter::Dir'}{prefix_url} = '/myfiles';

is( request('/badurl/catalyst.png')->code,'404', 'bad prefix_url, do 404' );
ok( request('/.static/catalyst.png')->is_success, 'view image' );
contenttype_is('/.static/catalyst.png', 'image/png', 'show image type' )