Nils Diewald | 034ea70 | 2015-01-16 19:41:52 +0000 | [diff] [blame] | 1 | use Mojo::Base -strict; |
| 2 | use lib '../lib', 'lib'; |
| 3 | use Test::More; |
| 4 | use Test::Mojo; |
| 5 | |
| 6 | my $t = Test::Mojo->new('Korap'); |
| 7 | $t->get_ok('/') |
| 8 | ->status_is(200) |
| 9 | ->text_is('title', 'KorAP') |
| 10 | ->text_like('h1 span', qr/Korpusanalyseplattform/i) |
| 11 | ; |
| 12 | |
| 13 | # Check paging |
| 14 | $t->get_ok('/?q=test') |
| 15 | ->text_is('pre.query.serial span', 'JSON-LD Serialization for "test"') |
| 16 | ->text_like('#total-results', qr/\d+ matches$/) |
| 17 | ->text_is('#pagination a[rel=self] span', 1) |
| 18 | ; |
| 19 | |
| 20 | # Check paging |
| 21 | $t->get_ok('/?q=test&p=2') |
| 22 | ->text_is('pre.query.serial span', 'JSON-LD Serialization for "test"') |
| 23 | ->text_like('#total-results', qr/\d+ matches$/) |
| 24 | ->text_is('#pagination a[rel=self] span', 2) |
| 25 | ; |
| 26 | |
| 27 | # $t->get_ok('/tutorial?testing=1') |
| 28 | # ->text_like('div.test p.pass', qr/Pass: [1-9]/) |
| 29 | # ; |
| 30 | |
| 31 | done_testing(); |