Tutorial queries can now be unavailable for certain corpora
Change-Id: Ib52cf6dfc2a020893dd6b252a3d1f5ddd53e936c
diff --git a/t/doc.t b/t/doc.t
index b16e1d9..55ac2a5 100644
--- a/t/doc.t
+++ b/t/doc.t
@@ -54,5 +54,36 @@
->status_is(200)
->text_is("title", "KorAP: Annis QL");
+# Check corpus examples
+$t->get_ok('/doc/ql/poliqarp-plus')
+ ->status_is(200)
+ ->text_is('#segments pre.query.tutorial:nth-of-type(1) code', 'Baum');
+
+my $app = $t->app;
+
+$app->plugin(
+ 'Localize' => {
+ dict => {
+ Q => {
+ newexample => {
+ poliqarp => {
+ simple => '** Beispiel'
+ }
+ }
+ }
+ }
+ }
+);
+
+# Set other example query
+$app->config('Kalamar')->{examplecorpus} = 'newexample';
+
+is($app->loc('Q_poliqarp_simple'), '** Beispiel');
+
+# Check corpus examples
+$t->get_ok('/doc/ql/poliqarp-plus')
+ ->status_is(200)
+ ->text_is('#segments pre.query.tutorial:nth-of-type(1) code', 'Beispiel')
+ ->text_is('#segments pre.query.tutorial:nth-of-type(1) span', '*');
done_testing();