Bugzilla – Attachment 166381 Details for
Bug 36618
Make creation of bibliographic records optional for ERM local titles
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36618: Add unit tests
Bug-36618-Add-unit-tests.patch (text/plain), 2.30 KB, created by
Matt Blenkinsop
on 2024-05-08 10:45:05 UTC
(
hide
)
Description:
Bug 36618: Add unit tests
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-05-08 10:45:05 UTC
Size:
2.30 KB
patch
obsolete
>From cc3764adeef1fcebcc9be6fa42f734c96e4a63de Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Wed, 17 Apr 2024 10:34:49 +0000 >Subject: [PATCH] Bug 36618: Add unit tests > >prove t/db_dependent/api/v1/erm_eholdings_titles.t >--- > t/db_dependent/api/v1/erm_eholdings_titles.t | 24 ++++++++++++++++---- > 1 file changed, 20 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/api/v1/erm_eholdings_titles.t b/t/db_dependent/api/v1/erm_eholdings_titles.t >index 2c7802f1c1..866310bfd3 100755 >--- a/t/db_dependent/api/v1/erm_eholdings_titles.t >+++ b/t/db_dependent/api/v1/erm_eholdings_titles.t >@@ -192,7 +192,7 @@ subtest 'get() tests' => sub { > > subtest 'add() tests' => sub { > >- plan tests => 24; >+ plan tests => 25; > > $schema->storage->txn_begin; > >@@ -331,6 +331,22 @@ subtest 'add() tests' => sub { > ] > ); > >+ subtest 'add eholdings title linked to biblio tests' => sub { >+ >+ plan tests => 4; >+ >+ delete $ehtitle->{title_id}; >+ my $request_body = { >+ %{$ehtitle}, >+ }; >+ $request_body->{create_linked_biblio} = 1; >+ my $biblios_count = Koha::Biblios->search()->count; >+ $t->post_ok( "//$userid:$password@/api/v1/erm/eholdings/local/titles/" => json => $request_body ) >+ ->status_is(201)->json_is( '/publication_title' => 'Publication title' ); >+ my $new_biblios_count = Koha::Biblios->search()->count; >+ is( $new_biblios_count, $biblios_count + 1, "Biblio was added" ); >+ }; >+ > $schema->storage->txn_rollback; > }; > >@@ -471,9 +487,9 @@ subtest 'update() tests' => sub { > ->title_id; > my $ehtitle_updated_title = { publication_title => "The journal of writing unit tests :" }; > >- $t->put_ok( >- "//$userid:$password@/api/v1/erm/eholdings/local/titles/$ehtitle_id" => json => $ehtitle_updated_title ) >- ->status_is(200)->json_is( '/publication_title' => 'The journal of writing unit tests :' ); >+ $t->put_ok( "//$userid:$password@/api/v1/erm/eholdings/local/titles/$ehtitle_id" => json => >+ { %$ehtitle_updated_title, create_linked_biblio => 1 } )->status_is(200) >+ ->json_is( '/publication_title' => 'The journal of writing unit tests :' ); > > $biblio->discard_changes; > >-- >2.37.1 (Apple Git-137.1)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36618
:
164992
|
164993
|
166149
|
166150
|
166380
|
166381
|
166382
|
166386
|
166387
|
166388
|
167111