Lines 175-181
subtest 'update_notes() tests' => sub {
Link Here
|
175 |
|
175 |
|
176 |
subtest 'resolve_claim() tests' => sub { |
176 |
subtest 'resolve_claim() tests' => sub { |
177 |
|
177 |
|
178 |
plan tests => 8; |
178 |
plan tests => 12; |
179 |
|
179 |
|
180 |
$schema->storage->txn_begin; |
180 |
$schema->storage->txn_begin; |
181 |
|
181 |
|
Lines 193-198
subtest 'resolve_claim() tests' => sub {
Link Here
|
193 |
|
193 |
|
194 |
t::lib::Mocks::mock_userenv( { branchcode => $item->homebranch } ); # needed by AddIssue |
194 |
t::lib::Mocks::mock_userenv( { branchcode => $item->homebranch } ); # needed by AddIssue |
195 |
|
195 |
|
|
|
196 |
# Picking 1 that should exist |
197 |
my $ClaimReturnedLostValue = 1; |
198 |
t::lib::Mocks::mock_preference('ClaimReturnedLostValue', $ClaimReturnedLostValue); |
199 |
|
196 |
my $issue = AddIssue( $librarian->unblessed, $item->barcode, dt_from_string->add( weeks => 2 ) ); |
200 |
my $issue = AddIssue( $librarian->unblessed, $item->barcode, dt_from_string->add( weeks => 2 ) ); |
197 |
|
201 |
|
198 |
my $claim = $issue->claim_returned( |
202 |
my $claim = $issue->claim_returned( |
Lines 219-224
subtest 'resolve_claim() tests' => sub {
Link Here
|
219 |
is( $claim->resolved_by, $librarian->id ); |
223 |
is( $claim->resolved_by, $librarian->id ); |
220 |
ok( $claim->resolved_on ); |
224 |
ok( $claim->resolved_on ); |
221 |
|
225 |
|
|
|
226 |
is( $claim->checkout->item->itemlost, $ClaimReturnedLostValue ); |
227 |
|
228 |
$claim->update({resolution => undef, resolved_by => undef, resolved_on => undef }); |
229 |
$t->put_ok( |
230 |
"//$userid:$password@/api/v1/return_claims/$claim_id/resolve" => json => { |
231 |
resolved_by => $librarian->id, |
232 |
resolution => "FOUNDINLIB", |
233 |
new_lost_status => 0, |
234 |
} |
235 |
)->status_is(200); |
236 |
is( $claim->get_from_storage->checkout->item->itemlost, 0 ); |
237 |
|
238 |
|
222 |
# Make sure the claim doesn't exist on the DB anymore |
239 |
# Make sure the claim doesn't exist on the DB anymore |
223 |
$claim->delete; |
240 |
$claim->delete; |
224 |
|
241 |
|
225 |
- |
|
|