Akron | 4c33c62 | 2018-11-12 13:43:27 +0100 | [diff] [blame^] | 1 | use Mojo::Base -strict; |
| 2 | use Test::More; |
| 3 | use Test::Mojo; |
| 4 | |
| 5 | # Test the documentation |
| 6 | my $t = Test::Mojo->new('Kalamar'); |
| 7 | |
| 8 | $t->app->plugin('Piwik' => { |
| 9 | url => 'https://piwik.korap.ids-mannheim.de/', |
| 10 | site_id => 1, |
| 11 | embed => 1 |
| 12 | }); |
| 13 | |
| 14 | # Load piwik |
| 15 | $t->app->plugin('Kalamar::Plugin::Piwik'); |
| 16 | |
| 17 | $t->get_ok('/doc/faq') |
| 18 | ->status_is(200) |
| 19 | ->text_like('section[name=piwik-opt-out] h3', qr!can I opt-out!) |
| 20 | ->element_exists('section[name=piwik-opt-out] iframe') |
| 21 | ->content_like(qr!var _paq!) |
| 22 | ->content_like(qr!window\.addEventListener\('korapRequest!) |
| 23 | ; |
| 24 | |
| 25 | done_testing(); |