Restructure test suite
Change-Id: Ibbd4bbb27203f9ffa89ae3e3a36b16f455b3523c
diff --git a/t/query.t b/t/query.t
index 97f4997..933276f 100644
--- a/t/query.t
+++ b/t/query.t
@@ -14,11 +14,11 @@
# Mount fake backend
# Get the fixture path
-my $fixtures_path = path(Mojo::File->new(__FILE__)->dirname, 'fixtures');
+my $fixtures_path = path(Mojo::File->new(__FILE__)->dirname, 'server');
my $fake_backend = $t->app->plugin(
Mount => {
$mount_point =>
- $fixtures_path->child('fake_backend.pl')
+ $fixtures_path->child('mock.pl')
}
);
# Configure fake backend
@@ -79,6 +79,15 @@
->text_like('div.notify-error:nth-of-type(2)', qr!302: Could not parse query .+? \[orth=das.+?!)
;
+# Check for query error with ql (from remote.t)
+$t->get_ok('/?q=[orth=das&ql=poliqarp')
+ ->element_exists('.notify-error')
+ ->text_is('.notify-error', '302: Parantheses/brackets unbalanced.')
+ ->content_like(qr!KorAP\.koralQuery =!)
+ ->text_is('.no-results:nth-of-type(1)', 'Unable to perform the search.')
+ ;
+
+
# Query with partial cache (for total results)
$t->get_ok('/?q=baum')
->status_is(200)