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$/) |
Nils Diewald | 46e6f18 | 2015-02-04 15:22:49 +0000 | [diff] [blame] | 17 | ->element_exists('[title=Alignment]') |
Nils Diewald | 034ea70 | 2015-01-16 19:41:52 +0000 | [diff] [blame] | 18 | ->text_is('#pagination a[rel=self] span', 1) |
| 19 | ; |
| 20 | |
| 21 | # Check paging |
| 22 | $t->get_ok('/?q=test&p=2') |
| 23 | ->text_is('pre.query.serial span', 'JSON-LD Serialization for "test"') |
| 24 | ->text_like('#total-results', qr/\d+ matches$/) |
| 25 | ->text_is('#pagination a[rel=self] span', 2) |
| 26 | ; |
| 27 | |
| 28 | # $t->get_ok('/tutorial?testing=1') |
| 29 | # ->text_like('div.test p.pass', qr/Pass: [1-9]/) |
| 30 | # ; |
| 31 | |
| 32 | done_testing(); |