Introduced experimental API method and fixture system
Change-Id: Iffb6d3c4f7f21bcf40c904d40d137b206a3ba266
diff --git a/t/fixture.t b/t/fixture.t
new file mode 100644
index 0000000..15e4a87
--- /dev/null
+++ b/t/fixture.t
@@ -0,0 +1,36 @@
+use Mojo::Base -strict;
+use Test::More;
+use Test::Mojo;
+use Mojo::File qw/path/;
+
+# Get the fixture path
+my $fixtures_path = path(Mojo::File->new(__FILE__)->dirname, 'fixtures');
+
+my $t = Test::Mojo->new($fixtures_path->child('query_backend.pl'));
+
+$t->get_ok('/')
+ ->status_is(200)
+ ->content_is('Query fake server available');
+
+$t->get_ok('/search?ql=cosmas3')
+ ->status_is(400)
+ ->json_is('/errors/0/0',"307")
+ ->json_is('/errors/0/1',"cosmas3 is not a supported query language!")
+ ;
+
+$t->get_ok('/search?q=server_fail')
+ ->status_is(500)
+ ->content_like(qr!Oooops!)
+ ;
+
+$t->get_ok('/search?q=[orth=das&ql=poliqarp')
+ ->status_is(400)
+ ->json_is('/errors/0/0',302)
+ ->json_is('/errors/0/1','Parantheses/brackets unbalanced.')
+ ->json_is('/errors/1/0',302)
+ ->json_is('/errors/1/1','Could not parse query >>> [orth=das <<<.')
+ ;
+
+
+done_testing;
+__END__