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

(-)a/t/db_dependent/api/v1/patrons_recalls.t (-2 / +13 lines)
Lines 34-40 t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 ); Link Here
34
34
35
subtest 'list() tests' => sub {
35
subtest 'list() tests' => sub {
36
36
37
    plan tests => 9;
37
    plan tests => 15;
38
38
39
    $schema->storage->txn_begin;
39
    $schema->storage->txn_begin;
40
40
Lines 54-63 subtest 'list() tests' => sub { Link Here
54
    my $recall_1 = $builder->build_object( { class => 'Koha::Recalls', value => { patron_id => $patron->id } } );
54
    my $recall_1 = $builder->build_object( { class => 'Koha::Recalls', value => { patron_id => $patron->id } } );
55
    my $recall_2 = $builder->build_object( { class => 'Koha::Recalls', value => { patron_id => $patron->id } } );
55
    my $recall_2 = $builder->build_object( { class => 'Koha::Recalls', value => { patron_id => $patron->id } } );
56
56
57
    # Add another patron
58
    my $patron_2 = $builder->build_object( { class => 'Koha::Patrons' } );
59
    my $recall_3 = $builder->build_object( { class => 'Koha::Recalls', value => { patron_id => $patron_2->id } } );
60
57
    $t->get_ok( "//$userid:$password@/api/v1/patrons/" . $patron->id . '/recalls?_order_by=+me.recall_id' )
61
    $t->get_ok( "//$userid:$password@/api/v1/patrons/" . $patron->id . '/recalls?_order_by=+me.recall_id' )
58
        ->status_is( 200, 'SWAGGER3.2.2' )
62
        ->status_is( 200, 'SWAGGER3.2.2' )
59
        ->json_is( '' => [ $recall_1->to_api, $recall_2->to_api ], 'Recalls retrieved' );
63
        ->json_is( '' => [ $recall_1->to_api, $recall_2->to_api ], 'Recalls retrieved' );
60
64
65
    $t->get_ok( "//$userid:$password@/api/v1/patrons/" . $patron_2->id . '/recalls?_order_by=+me.recall_id' )
66
        ->status_is( 200, 'SWAGGER3.2.2' )->json_is( '' => [ $recall_3->to_api ], 'Recalls retrieved' );
67
68
    $recall_3->delete;
69
70
    $t->get_ok( "//$userid:$password@/api/v1/patrons/" . $patron_2->id . '/recalls?_order_by=+me.recall_id' )
71
        ->status_is( 200, 'SWAGGER3.2.2' )->json_is( [] );
72
61
    my $non_existent_patron    = $builder->build_object( { class => 'Koha::Patrons' } );
73
    my $non_existent_patron    = $builder->build_object( { class => 'Koha::Patrons' } );
62
    my $non_existent_patron_id = $non_existent_patron->id;
74
    my $non_existent_patron_id = $non_existent_patron->id;
63
75
64
- 

Return to bug 35967