|
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 => 9; |
178 |
plan tests => 13; |
| 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 225-230
subtest 'resolve_claim() tests' => sub {
Link Here
|
| 225 |
is( $claim->updated_by, $librarian->id ); |
229 |
is( $claim->updated_by, $librarian->id ); |
| 226 |
ok( $claim->resolved_on ); |
230 |
ok( $claim->resolved_on ); |
| 227 |
|
231 |
|
|
|
232 |
is( $claim->checkout->item->itemlost, $ClaimReturnedLostValue ); |
| 233 |
|
| 234 |
$claim->update({resolution => undef, resolved_by => undef, resolved_on => undef }); |
| 235 |
$t->put_ok( |
| 236 |
"//$userid:$password@/api/v1/return_claims/$claim_id/resolve" => json => { |
| 237 |
resolved_by => $librarian->id, |
| 238 |
resolution => "FOUNDINLIB", |
| 239 |
new_lost_status => 0, |
| 240 |
} |
| 241 |
)->status_is(200); |
| 242 |
is( $claim->get_from_storage->checkout->item->itemlost, 0 ); |
| 243 |
|
| 244 |
|
| 228 |
# Make sure the claim doesn't exist on the DB anymore |
245 |
# Make sure the claim doesn't exist on the DB anymore |
| 229 |
$claim->delete; |
246 |
$claim->delete; |
| 230 |
|
247 |
|
| 231 |
- |
|
|