blob: 30156ead694e231f7c1ef9b046b0ad84bcc5e231 [file] [log] [blame]
Nils Diewald034ea702015-01-16 19:41:52 +00001use Mojo::Base -strict;
2use lib '../lib', 'lib';
Nils Diewalda748b0e2015-05-19 22:54:06 +00003use Test::More skip_all => 'No remote tests';
Nils Diewald034ea702015-01-16 19:41:52 +00004use Test::Mojo;
5
Nils Diewald2fe12e12015-03-06 16:47:06 +00006my $t = Test::Mojo->new('Kalamar');
Nils Diewald034ea702015-01-16 19:41:52 +00007$t->get_ok('/')
8 ->status_is(200)
Nils Diewalda748b0e2015-05-19 22:54:06 +00009 ->text_is('title', 'KorAP - Corpus Analysis Platform')
10 ->text_like('h1 span', qr/KorAP - Corpus Analysis Platform/i)
Nils Diewald034ea702015-01-16 19:41:52 +000011 ;
12
13# Check paging
14$t->get_ok('/?q=test')
Nils Diewalda748b0e2015-05-19 22:54:06 +000015 ->text_like('h1 span', qr/KorAP: Find "test"/i)
16 # ->text_is('pre.query.serial span', 'JSON-LD Serialization for "test"')
17 ->text_like('#total-results', qr/\d+$/)
Nils Diewald034ea702015-01-16 19:41:52 +000018 ->text_is('#pagination a[rel=self] span', 1)
19;
20
21# Check paging
22$t->get_ok('/?q=test&p=2')
Nils Diewalda748b0e2015-05-19 22:54:06 +000023 # ->text_is('pre.query.serial span', 'JSON-LD Serialization for "test"')
24 ->text_like('#total-results', qr/\d+$/)
Nils Diewald034ea702015-01-16 19:41:52 +000025 ->text_is('#pagination a[rel=self] span', 2)
26;
27
Nils Diewalda748b0e2015-05-19 22:54:06 +000028done_testing;
29__END__