Bug 30194: (follow-up) Remove invalid tests

This patch removes tests for the wrong 'Accept' header situation. It is
the only thing I found I could do.

The situation is: the JSON::Validator + Mojolicious::Plugin::OpenAPI is
trapping this case and returning its own error code (400) and it also
builds its own message! So no point testing it, as it can change again.

I post it as a separate patch just in case someone finds a better way to
handle this and obsoletes the patch :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Tomas Cohen Arazi 2022-03-08 15:43:28 -03:00 committed by Fridolin Somers
parent 973564f8ef
commit 27698df8f8
1 changed files with 4 additions and 13 deletions

View File

@ -45,7 +45,7 @@ my $t = Test::Mojo->new('Koha::REST::V1');
subtest 'get() tests' => sub {
plan tests => 22;
plan tests => 21;
$schema->storage->txn_begin;
@ -71,12 +71,7 @@ subtest 'get() tests' => sub {
$t->get_ok( "//$userid:$password@/api/v1/biblios/" . $biblio->biblionumber
=> { Accept => 'application/weird+format' } )
->status_is(406)
->json_is( [ "application/json",
"application/marcxml+xml",
"application/marc-in-json",
"application/marc",
"text/plain" ] );
->status_is(400);
$t->get_ok( "//$userid:$password@/api/v1/biblios/" . $biblio->biblionumber
=> { Accept => 'application/json' } )
@ -223,7 +218,7 @@ subtest 'delete() tests' => sub {
subtest 'get_public() tests' => sub {
plan tests => 26;
plan tests => 25;
$schema->storage->txn_begin;
@ -256,11 +251,7 @@ subtest 'get_public() tests' => sub {
$t->get_ok( "//$userid:$password@/api/v1/public/biblios/" . $biblio->biblionumber
=> { Accept => 'application/weird+format' } )
->status_is(406)
->json_is( [ "application/marcxml+xml",
"application/marc-in-json",
"application/marc",
"text/plain" ] );
->status_is(400);
$t->get_ok( "//$userid:$password@/api/v1/public/biblios/" . $biblio->biblionumber
=> { Accept => 'text/plain' } )