blob: 029cb334bc45c14d37c0128eceaa2497662261f7 [file] [log] [blame]
Akron9490e3b2019-10-17 12:26:29 +02001use Mojo::Base -strict;
2use Test::More;
3use Test::Mojo;
4
5# Test the documentation
6
7my $t = Test::Mojo->new('Kalamar');
8
9my $app = $t->app;
10
11is($app->under_construction, '<p>Under Construction!</p>');
12
Akron3cfa26d2019-10-24 15:17:34 +020013is($app->embedded_link_to('doc', 'privacy', 'privacy'), '<a class="embedded-link" href="/doc/privacy">privacy</a>');
14is($app->embedded_link_to('doc', 'privacy', 'korap', 'privacy'), '<a class="embedded-link" href="/doc/korap/privacy">privacy</a>');
Akron9490e3b2019-10-17 12:26:29 +020015
16
17my $c = $app->build_controller;
18$c->title('Example');
19is($c->page_title, '<h2 id="page-top">Example</h2>');
20
Akron90be03b2020-02-03 16:13:37 +010021$t->get_ok('/' => { 'X-Forwarded-Host' => 'korap2.ids-mannheim.de'})
22 ->attr_is('meta[property="og:url"]', 'content', '//korap2.ids-mannheim.de/')
23 ;
24
Akronbc6b3f22021-01-13 14:53:12 +010025$t->get_ok('/')
26 ->header_like('Content-Security-Policy', qr!default-src 'self';!)
27 ->header_like('Content-Security-Policy', qr!media-src 'none';!)
28 ->header_like('Content-Security-Policy', qr!object-src 'self';!)
29 ;
30
Akron9490e3b2019-10-17 12:26:29 +020031done_testing;
32
331;