|
Lines 17-25
Link Here
|
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
| 20 |
use Test::More tests => 25; |
20 |
use Test::More tests => 27; |
| 21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
| 22 |
use Test::Mojo; |
22 |
use Test::Mojo; |
|
|
23 |
use Test::Warn; |
| 23 |
use t::lib::Mocks; |
24 |
use t::lib::Mocks; |
| 24 |
use t::lib::TestBuilder; |
25 |
use t::lib::TestBuilder; |
| 25 |
|
26 |
|
|
Lines 97-114
$t->post_ok(
Link Here
|
| 97 |
created_by => $librarian->id, |
98 |
created_by => $librarian->id, |
| 98 |
notes => "This is a test note." |
99 |
notes => "This is a test note." |
| 99 |
} |
100 |
} |
| 100 |
)->status_is(201); |
101 |
)->status_is(201) |
|
|
102 |
->header_like( Location => qr|^\/api\/v1\/return_claims/\d*|, 'SWAGGER3.4.1'); |
| 103 |
|
| 101 |
my $claim_id = $t->tx->res->json->{claim_id}; |
104 |
my $claim_id = $t->tx->res->json->{claim_id}; |
| 102 |
|
105 |
|
| 103 |
## Duplicate id |
106 |
## Duplicate id |
| 104 |
$t->post_ok( |
107 |
warning_like { |
| 105 |
"//$userid:$password@/api/v1/return_claims" => json => { |
108 |
$t->post_ok( |
| 106 |
item_id => $itemnumber1, |
109 |
"//$userid:$password@/api/v1/return_claims" => json => { |
| 107 |
charge_lost_fee => Mojo::JSON->false, |
110 |
item_id => $itemnumber1, |
| 108 |
created_by => $librarian->id, |
111 |
charge_lost_fee => Mojo::JSON->false, |
| 109 |
notes => "This is a test note." |
112 |
created_by => $librarian->id, |
|
|
113 |
notes => "This is a test note." |
| 114 |
} |
| 115 |
)->status_is(409) |
| 110 |
} |
116 |
} |
| 111 |
)->status_is(400); |
117 |
qr/^DBD::mysql::st execute failed: Duplicate entry/; |
| 112 |
|
118 |
|
| 113 |
# Test editing a claim note |
119 |
# Test editing a claim note |
| 114 |
## Valid claim id |
120 |
## Valid claim id |
| 115 |
- |
|
|