Bugzilla – Attachment 82168 Details for
Bug 21413
Inventory - Allow skipping items with waiting holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21413: (QA follow-up) Fix tests
Bug-21413-QA-follow-up-Fix-tests.patch (text/plain), 2.38 KB, created by
Tomás Cohen Arazi
on 2018-11-09 14:07:48 UTC
(
hide
)
Description:
Bug 21413: (QA follow-up) Fix tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2018-11-09 14:07:48 UTC
Size:
2.38 KB
patch
obsolete
>From 08fa7014c065e5a5bf3d2e9e6fd50c52f45a068a Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 9 Nov 2018 10:54:12 -0300 >Subject: [PATCH] Bug 21413: (QA follow-up) Fix tests > >No assumption on the order in which restults are returned should be made >(we don't control existing data on the tests). So it should only check >existence of expected records in the results, and absense. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Items/GetItemsForInventory.t | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Items/GetItemsForInventory.t b/t/db_dependent/Items/GetItemsForInventory.t >index 39e0ae6696..fddea80ad0 100755 >--- a/t/db_dependent/Items/GetItemsForInventory.t >+++ b/t/db_dependent/Items/GetItemsForInventory.t >@@ -22,6 +22,8 @@ use Modern::Perl; > use Test::More tests => 7; > use t::lib::TestBuilder; > >+use List::MoreUtils qw( any none ); >+ > use C4::Biblio qw(AddBiblio); > use C4::Reserves; > use Koha::AuthorisedValues; >@@ -59,7 +61,7 @@ subtest 'Old version is unchanged' => sub { > > subtest 'Skip items with waiting holds' => sub { > >- plan tests => 5; >+ plan tests => 6; > > $schema->storage->txn_begin; > >@@ -69,8 +71,8 @@ subtest 'Skip items with waiting holds' => sub { > my $patron = $builder->build_object( > { class => 'Koha::Patrons', value => { branchcode => $library->id } } ); > >- my $title_1 = 'Title 1'; >- my $title_2 = 'Title 2'; >+ my $title_1 = 'Title 1, '; >+ my $title_2 = 'Title 2, bizzarre one so doesn\'t already exist'; > > my $biblio_1 = create_helper_biblio( $itemtype->itemtype, $title_1 ); > my $biblio_2 = create_helper_biblio( $itemtype->itemtype, $title_2 ); >@@ -117,8 +119,10 @@ subtest 'Skip items with waiting holds' => sub { > > my ( $new_items, $new_items_count ) = GetItemsForInventory( { ignore_waiting_holds => 1 } ); > is( $new_items_count, $first_items_count + 1, 'Item on hold skipped, count makes sense' ); >- is( $new_items->[ scalar @{$new_items} - 1 ]->{title}, >- $title_2, 'Item on hold skipped, last item is the correct one' ); >+ ok( (any { $_->{title} eq $title_2 } @{$new_items}), >+ 'Item on hold skipped, the other one we added is present' ); >+ ok( (none { $_->{title} eq $title_1 } @{$new_items}), >+ 'Item on hold skipped, no one matches' ); > > $schema->storage->txn_rollback; > }; >-- >2.19.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 21413
:
79432
|
79433
|
81376
|
81377
|
81378
|
81379
|
82040
|
82111
| 82168