Nils Diewald | 034ea70 | 2015-01-16 19:41:52 +0000 | [diff] [blame] | 1 | use Mojo::Base -strict; |
| 2 | use lib '../lib', 'lib'; |
Akron | 3042f24 | 2017-04-15 16:57:55 +0200 | [diff] [blame^] | 3 | use Test::More; |
Nils Diewald | 034ea70 | 2015-01-16 19:41:52 +0000 | [diff] [blame] | 4 | use Test::Mojo; |
| 5 | |
Akron | 3042f24 | 2017-04-15 16:57:55 +0200 | [diff] [blame^] | 6 | $ENV{MOJO_MODE} = 'test'; |
| 7 | |
Nils Diewald | 2fe12e1 | 2015-03-06 16:47:06 +0000 | [diff] [blame] | 8 | my $t = Test::Mojo->new('Kalamar'); |
Akron | 3042f24 | 2017-04-15 16:57:55 +0200 | [diff] [blame^] | 9 | |
Nils Diewald | 034ea70 | 2015-01-16 19:41:52 +0000 | [diff] [blame] | 10 | $t->get_ok('/') |
| 11 | ->status_is(200) |
Nils Diewald | a748b0e | 2015-05-19 22:54:06 +0000 | [diff] [blame] | 12 | ->text_is('title', 'KorAP - Corpus Analysis Platform') |
| 13 | ->text_like('h1 span', qr/KorAP - Corpus Analysis Platform/i) |
Nils Diewald | 034ea70 | 2015-01-16 19:41:52 +0000 | [diff] [blame] | 14 | ; |
| 15 | |
| 16 | # Check paging |
Akron | 3042f24 | 2017-04-15 16:57:55 +0200 | [diff] [blame^] | 17 | $t->get_ok('/?q=Baum') |
| 18 | ->text_like('h1 span', qr/KorAP: Find .Baum./i) |
Nils Diewald | a748b0e | 2015-05-19 22:54:06 +0000 | [diff] [blame] | 19 | # ->text_is('pre.query.serial span', 'JSON-LD Serialization for "test"') |
| 20 | ->text_like('#total-results', qr/\d+$/) |
Nils Diewald | 034ea70 | 2015-01-16 19:41:52 +0000 | [diff] [blame] | 21 | ->text_is('#pagination a[rel=self] span', 1) |
Akron | 3042f24 | 2017-04-15 16:57:55 +0200 | [diff] [blame^] | 22 | ; |
| 23 | |
| 24 | done_testing; |
| 25 | __END__ |
Nils Diewald | 034ea70 | 2015-01-16 19:41:52 +0000 | [diff] [blame] | 26 | |
| 27 | # Check paging |
| 28 | $t->get_ok('/?q=test&p=2') |
Nils Diewald | a748b0e | 2015-05-19 22:54:06 +0000 | [diff] [blame] | 29 | # ->text_is('pre.query.serial span', 'JSON-LD Serialization for "test"') |
| 30 | ->text_like('#total-results', qr/\d+$/) |
Nils Diewald | 034ea70 | 2015-01-16 19:41:52 +0000 | [diff] [blame] | 31 | ->text_is('#pagination a[rel=self] span', 2) |
| 32 | ; |
| 33 | |
Nils Diewald | a748b0e | 2015-05-19 22:54:06 +0000 | [diff] [blame] | 34 | done_testing; |
| 35 | __END__ |