Bug 24908: Unit tests
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 19 Mar 2020 15:04:27 +0000 (12:04 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 29 Apr 2020 16:13:30 +0000 (17:13 +0100)
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>

t/db_dependent/api/v1/biblios.t

index ccc59ec..66d423d 100644 (file)
@@ -38,7 +38,7 @@ my $t = Test::Mojo->new('Koha::REST::V1');
 
 subtest 'get() tests' => sub {
 
-    plan tests => 18;
+    plan tests => 21;
 
     $schema->storage->txn_begin;
 
@@ -68,7 +68,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' } )
@@ -88,6 +89,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' } )