Akron | 9490e3b | 2019-10-17 12:26:29 +0200 | [diff] [blame] | 1 | use Mojo::Base -strict; |
| 2 | use Test::More; |
| 3 | use Test::Mojo; |
| 4 | |
| 5 | # Test the documentation |
| 6 | |
| 7 | my $t = Test::Mojo->new('Kalamar'); |
| 8 | |
| 9 | my $app = $t->app; |
| 10 | |
| 11 | is($app->under_construction, '<p>Under Construction!</p>'); |
| 12 | |
Akron | 3cfa26d | 2019-10-24 15:17:34 +0200 | [diff] [blame] | 13 | is($app->embedded_link_to('doc', 'privacy', 'privacy'), '<a class="embedded-link" href="/doc/privacy">privacy</a>'); |
| 14 | is($app->embedded_link_to('doc', 'privacy', 'korap', 'privacy'), '<a class="embedded-link" href="/doc/korap/privacy">privacy</a>'); |
Akron | 9490e3b | 2019-10-17 12:26:29 +0200 | [diff] [blame] | 15 | |
| 16 | |
| 17 | my $c = $app->build_controller; |
| 18 | $c->title('Example'); |
| 19 | is($c->page_title, '<h2 id="page-top">Example</h2>'); |
| 20 | |
Akron | 90be03b | 2020-02-03 16:13:37 +0100 | [diff] [blame] | 21 | $t->get_ok('/' => { 'X-Forwarded-Host' => 'korap2.ids-mannheim.de'}) |
| 22 | ->attr_is('meta[property="og:url"]', 'content', '//korap2.ids-mannheim.de/') |
| 23 | ; |
| 24 | |
Akron | bc6b3f2 | 2021-01-13 14:53:12 +0100 | [diff] [blame] | 25 | $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 | |
Akron | 9490e3b | 2019-10-17 12:26:29 +0200 | [diff] [blame] | 31 | done_testing; |
| 32 | |
| 33 | 1; |