Add query parameter validation
Change-Id: Ib0fa76faf0c70bb8373bf723f238c9e88b5b890a
diff --git a/t/query.t b/t/query.t
index 933276f..59d8fc9 100644
--- a/t/query.t
+++ b/t/query.t
@@ -157,7 +157,22 @@
->content_like(qr!\"cutOff":true!)
;
-
+# Query with failing parameters
+$t->get_ok('/?q=fantastisch&ql=Fabelsprache')
+ ->status_is(400)
+ ->text_is('noscript div.notify-error', 'Parameter "ql" invalid')
+ ->element_count_is('noscript div.notify-error', 1)
+ ;
+$t->get_ok('/?q=fantastisch&cutoff=no')
+ ->status_is(400)
+ ->text_is('noscript div.notify-error', 'Parameter "cutoff" invalid')
+ ->element_count_is('noscript div.notify-error', 1)
+ ;
+$t->get_ok('/?q=fantastisch&p=hui&o=hui&count=-8')
+ ->status_is(400)
+ ->text_like('noscript div.notify-error', qr!Parameter ".+?" invalid!)
+ ->element_count_is('noscript div.notify-error', 3)
+ ;
done_testing;