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

(-)a/t/db_dependent/api/v1/ill_requests.t (-5 / +25 lines)
Lines 139-147 subtest 'list() tests' => sub { Link Here
139
    };
139
    };
140
140
141
    # Create some ILL requests
141
    # Create some ILL requests
142
    my $req_1 = $builder->build_object({ class => 'Koha::Illrequests', value => { borrowernumber => $patron->borrowernumber, status => $request_status->{code}, backend =>$backend->name } });
142
    my $req_1 = $builder->build_object(
143
    my $req_2 = $builder->build_object({ class => 'Koha::Illrequests', value => { status => $request_status->{code}, backend =>$backend->name , status_alias => $av->authorised_value } } );
143
        {
144
    my $ret   = $builder->build_object({ class => 'Koha::Illrequests', value => { status => 'RET' } } );
144
            class => 'Koha::Illrequests',
145
            value => {
146
                borrowernumber => $patron->borrowernumber,
147
                status         => $request_status->{code},
148
                backend        => $backend->name,
149
                notesstaff     => '1'
150
            }
151
        }
152
    );
153
    my $req_2 = $builder->build_object(
154
        {
155
            class => 'Koha::Illrequests',
156
            value => {
157
                status       => $request_status->{code},
158
                backend      => $backend->name,
159
                status_alias => $av->authorised_value,
160
                notesstaff   => '2'
161
            }
162
163
        }
164
    );
165
    my $ret = $builder->build_object({ class => 'Koha::Illrequests', value => { status => 'RET' } });
145
166
146
    # Three requests exist, expect all three to be returned
167
    # Three requests exist, expect all three to be returned
147
    $t->get_ok("//$userid:$password@/api/v1/ill/requests")
168
    $t->get_ok("//$userid:$password@/api/v1/ill/requests")
Lines 209-215 subtest 'list() tests' => sub { Link Here
209
230
210
    # Hide 'RET', expect to return 2 'REQ'
231
    # Hide 'RET', expect to return 2 'REQ'
211
    t::lib::Mocks::mock_preference( 'ILLHiddenRequestStatuses', 'RET' );
232
    t::lib::Mocks::mock_preference( 'ILLHiddenRequestStatuses', 'RET' );
212
    $t->get_ok( "//$userid:$password@/api/v1/ill/requests" )
233
    $t->get_ok( "//$userid:$password@/api/v1/ill/requests?_order_by=staff_notes" )
213
      ->status_is(200)
234
      ->status_is(200)
214
      ->json_is( [ $req_1->to_api, $req_2->to_api ]);
235
      ->json_is( [ $req_1->to_api, $req_2->to_api ]);
215
236
216
- 

Return to bug 33834