| my $fixtures_path = path(Mojo::File->new(__FILE__)->dirname, 'fixtures'); |
| my $t = Test::Mojo->new($fixtures_path->child('query_backend.pl')); |
| ->content_is('Query fake server available'); |
| $t->get_ok('/search?ql=cosmas3') |
| ->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') |
| ->content_like(qr!Oooops!) |
| $t->get_ok('/search?q=[orth=das&ql=poliqarp') |
| ->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 <<<.') |