File: scrubber.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 (33 lines) | stat: -rw-r--r-- 825 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use strict;
use warnings;

use RT::Test tests => undef;

my $ticket = RT::Test->create_ticket(
    Queue       => 'General',
    Subject     => 'test scrubber',
    ContentType => 'text/html',
    Content     => <<'EOF' );
Image start
<img src="https://example.com/test.png">
Image end
EOF

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

$m->goto_ticket( $ticket->Id );

$m->content_lacks('<img src="https://example.com/test.png">', 'Remote images are not shown by default');

my $config = RT::Configuration->new( RT->SystemUser );
my ( $ret, $msg ) = $config->Create(
    Name    => 'ShowRemoteImages',
    Content => 1,
);
ok( $ret, 'Updated config' );

$m->reload;
$m->content_contains('<img src="https://example.com/test.png">', 'Remote images are shown with ShowRemoteImages=1');

done_testing;