View | Details | Raw Unified | Return to bug 29332
Collapse All | Expand All

(-)a/t/db_dependent/Koha/AdditionalContents.t (-5 / +8 lines)
Lines 157-163 subtest '->author' => sub { Link Here
157
157
158
subtest '->search_for_display' => sub {
158
subtest '->search_for_display' => sub {
159
159
160
    plan tests => 3;
160
    plan tests => 4;
161
161
162
    $schema->storage->txn_begin;
162
    $schema->storage->txn_begin;
163
163
Lines 243-255 subtest '->search_for_display' => sub { Link Here
243
    });
243
    });
244
244
245
    my $news = Koha::AdditionalContents->search_for_display({ location => 'staff_only' });
245
    my $news = Koha::AdditionalContents->search_for_display({ location => 'staff_only' });
246
    is($news->count, 3, "There are 3 news for staff");
246
    is($news->count, 1, "There is 1 news for all staff");
247
248
    $news = Koha::AdditionalContents->search_for_display(
249
        { location => 'staff_only', library_id => $library1->branchcode } );
250
    is( $news->count, 2, "There are 2 news for staff at library1" );
247
251
248
    $news = Koha::AdditionalContents->search_for_display({ location => 'opac_only' });
252
    $news = Koha::AdditionalContents->search_for_display({ location => 'opac_only' });
249
    is($news->count, 0, "There are 0 news for OPAC");
253
    is($news->count, 0, "There are 0 news for OPAC only");
250
254
251
    $news = Koha::AdditionalContents->search_for_display({ location => 'staff_and_opac' });
255
    $news = Koha::AdditionalContents->search_for_display({ location => 'staff_and_opac' });
252
    is($news->count, 1, "There is 1 news for staff and OPAC");
256
    is($news->count, 1, "There is 1 news for all staff and all OPAC ");
253
257
254
    # TODO We should add more tests here
258
    # TODO We should add more tests here
255
259
256
- 

Return to bug 29332