Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 98; |
20 |
use Test::More tests => 99; |
21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
22 |
use Test::Mojo; |
22 |
use Test::Mojo; |
23 |
use t::lib::Mocks; |
23 |
use t::lib::Mocks; |
Lines 182-192
my $expected_datedue = $date_due
Link Here
|
182 |
->set_time_zone('local') |
182 |
->set_time_zone('local') |
183 |
->add(days => 7) |
183 |
->add(days => 7) |
184 |
->set(hour => 23, minute => 59, second => 0); |
184 |
->set(hour => 23, minute => 59, second => 0); |
|
|
185 |
|
185 |
$t->post_ok ( "//$userid:$password@/api/v1/checkouts/" . $issue1->issue_id . "/renewal" ) |
186 |
$t->post_ok ( "//$userid:$password@/api/v1/checkouts/" . $issue1->issue_id . "/renewal" ) |
186 |
->status_is(201) |
187 |
->status_is(201) |
187 |
->json_is('/due_date' => output_pref( { dateformat => "rfc3339", dt => $expected_datedue }) ) |
188 |
->json_is('/due_date' => output_pref( { dateformat => "rfc3339", dt => $expected_datedue }) ) |
188 |
->header_is(Location => "/api/v1/checkouts/" . $issue1->issue_id . "/renewal"); |
189 |
->header_is(Location => "/api/v1/checkouts/" . $issue1->issue_id . "/renewal"); |
189 |
|
190 |
|
|
|
191 |
my $renewal = $issue1->renewals->last; |
192 |
is( $renewal->renewal_type, 'Manual', 'Manual renewal recorded' ); |
193 |
|
190 |
$t->get_ok ( "//$userid:$password@/api/v1/checkouts/" . $issue1->issue_id . "/renewals" ) |
194 |
$t->get_ok ( "//$userid:$password@/api/v1/checkouts/" . $issue1->issue_id . "/renewals" ) |
191 |
->status_is(200) |
195 |
->status_is(200) |
192 |
->json_is('/0/checkout_id' => $issue1->issue_id) |
196 |
->json_is('/0/checkout_id' => $issue1->issue_id) |
193 |
- |
|
|