Bug 24908: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
This commit is contained in:
Tomas Cohen Arazi 2020-03-19 12:04:27 -03:00 committed by Joy Nelson
parent cd7ab5328b
commit 7f99b5a1a0
1 changed files with 8 additions and 2 deletions

View File

@ -37,7 +37,7 @@ my $t = Test::Mojo->new('Koha::REST::V1');
subtest 'get() tests' => sub {
plan tests => 18;
plan tests => 21;
$schema->storage->txn_begin;
@ -67,7 +67,8 @@ subtest 'get() tests' => sub {
->json_is( [ "application/json",
"application/marcxml+xml",
"application/marc-in-json",
"application/marc" ] );
"application/marc",
"text/plain" ] );
$t->get_ok( "//$userid:$password@/api/v1/biblios/" . $biblio->biblionumber
=> { Accept => 'application/json' } )
@ -87,6 +88,11 @@ subtest 'get() tests' => sub {
=> { Accept => 'application/marc' } )
->status_is(200);
$t->get_ok( "//$userid:$password@/api/v1/biblios/" . $biblio->biblionumber
=> { Accept => 'text/plain' } )
->status_is(200)
->content_is($biblio->metadata->record->as_formatted);
$biblio->delete;
$t->get_ok( "//$userid:$password@/api/v1/biblios/" . $biblio->biblionumber
=> { Accept => 'application/marc' } )