Add error check to corpus_info
Change-Id: I59a158691b88407625741124cc036bc494f16434
diff --git a/t/corpus_info.t b/t/corpus_info.t
index e245422..e5d1987 100644
--- a/t/corpus_info.t
+++ b/t/corpus_info.t
@@ -34,11 +34,17 @@
;
$t->get_ok('/corpus2?cq=docSigle+%3D+\"GOE/AGA\"')
+ ->status_is(200)
->json_is('/documents', 5)
->json_is('/tokens', 108557)
->json_is('/sentences', 3835)
->json_is('/paragraphs', 124)
;
+$t->get_ok('/corpus2?cq=4')
+ ->status_is(400)
+ ->json_is('/notifications/0/1', "302: Could not parse query >>> (4) <<<.")
+ ;
+
done_testing;
__END__
diff --git a/t/fixtures/response_corpusinfo_4.json b/t/fixtures/response_corpusinfo_4.json
new file mode 100644
index 0000000..0fe2a70
--- /dev/null
+++ b/t/fixtures/response_corpusinfo_4.json
@@ -0,0 +1,9 @@
+{
+ "status" : 400,
+ "json" : {
+ "errors":
+ [
+ [302,"Could not parse query >>> (4) <<<.","(4)"]
+ ]
+ }
+}