Added matchinfo tests
Change-Id: Idfbc7ebf3a1dd8524425999b4ab15cbe64bb68c8
diff --git a/t/match_info.t b/t/match_info.t
index 42a1aa7..3e4b72c 100644
--- a/t/match_info.t
+++ b/t/match_info.t
@@ -28,6 +28,46 @@
$t->get_ok('/corpus2/WPD15/232/39681/p2133-2134?spans=false&foundry=*')
->status_is(200)
->json_is('/textSigle', 'WPD15/232/39681')
+ ->json_like('/snippet', qr!<span class=\"context-left\">!)
;
+$t->get_ok('/corpus2/GOE/AGF/02286/p75682-75683')
+ ->status_is(200)
+ ->json_is('/textSigle', 'GOE/AGF/02286')
+ ->json_is('/title','Materialien zur Geschichte der Farbenlehre')
+ ;
+
+# TODO:
+# It's surprising, that it doesn't return a 404!
+$t->get_ok('/corpus2/notfound/X/X/p0-1')
+ ->status_is(200)
+ ->json_is('/textSigle', 'NOTFOUND/X/X')
+ ->json_is('/corpusID', undef)
+ ;
+
+# TODO:
+# Should probably return a 500!
+$t->get_ok('/corpus2/fail/x/x/p0-0')
+ ->status_is(200)
+ ->json_is('/notifications/0/0', 'error')
+ ->json_is('/notifications/0/1', '500: Internal Server Error')
+ ;
+
+# TODO:
+# Should probably return a 4xx!
+$t->get_ok('/corpus2/GOE/AGF/02286/p-2-0')
+ ->status_is(200)
+ ->json_is('/notifications/0/0', 'error')
+ ->json_is('/notifications/0/1', '730: Invalid match identifier')
+ ;
+
+# TODO:
+# It's surprising, that it doesn't return a 404!
+$t->get_ok('/corpus2/notfound2/X/X/p0-1')
+ ->status_is(200)
+ ->json_is('/notifications/0/0', 'error')
+ ->json_is('/notifications/0/1', '404: Not Found')
+ ;
+
+
done_testing;