Lines 90-96
subtest 'CRUD' => sub {
Link Here
|
90 |
}; |
90 |
}; |
91 |
|
91 |
|
92 |
subtest 'Sharing' => sub { |
92 |
subtest 'Sharing' => sub { |
93 |
plan tests => 18; |
93 |
plan tests => 21; |
94 |
my $patron_wants_to_share = $builder->build({ |
94 |
my $patron_wants_to_share = $builder->build({ |
95 |
source => 'Borrower', |
95 |
source => 'Borrower', |
96 |
}); |
96 |
}); |
Lines 152-157
subtest 'Sharing' => sub {
Link Here
|
152 |
$number_of_shelves_shared = Koha::Virtualshelfshares->search->count; |
152 |
$number_of_shelves_shared = Koha::Virtualshelfshares->search->count; |
153 |
is( $number_of_shelves_shared, 2, 'To be sure no shares have been removed' ); |
153 |
is( $number_of_shelves_shared, 2, 'To be sure no shares have been removed' ); |
154 |
|
154 |
|
|
|
155 |
# Test double accept (BZ 11943) before removing the accepted share |
156 |
my $third_share = $shelf_to_share->share('valid key number 2'); |
157 |
is( Koha::Virtualshelfshares->search->count, 3, 'Three shares' ); |
158 |
$is_accepted = $third_share->accept( 'valid key number 2', $share_with_me->{borrowernumber} ); |
159 |
is( $is_accepted->shelfnumber, $shelf_to_share->shelfnumber, 'Accept returned the existing share' ); |
160 |
is( Koha::Virtualshelfshares->search->count, 2, 'Check that number of shares went down again' ); |
161 |
|
162 |
# Remove the first accept |
155 |
is( $shelf_to_share->remove_share( $share_with_me->{borrowernumber} ), 1, '1 share should have been removed if the shelf was shared with this patron' ); |
163 |
is( $shelf_to_share->remove_share( $share_with_me->{borrowernumber} ), 1, '1 share should have been removed if the shelf was shared with this patron' ); |
156 |
$number_of_shelves_shared = Koha::Virtualshelfshares->search->count; |
164 |
$number_of_shelves_shared = Koha::Virtualshelfshares->search->count; |
157 |
is( $number_of_shelves_shared, 1, 'To be sure the share has been removed' ); |
165 |
is( $number_of_shelves_shared, 1, 'To be sure the share has been removed' ); |
158 |
- |
|
|