|
Lines 17-23
Link Here
|
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
| 20 |
use Test::More tests => 28; |
20 |
use Test::More tests => 31; |
| 21 |
use Test::Mojo; |
21 |
use Test::Mojo; |
| 22 |
|
22 |
|
| 23 |
use t::lib::TestBuilder; |
23 |
use t::lib::TestBuilder; |
|
Lines 85-93
my $job = $builder->build_object(
Link Here
|
| 85 |
} |
85 |
} |
| 86 |
); |
86 |
); |
| 87 |
|
87 |
|
|
|
88 |
my $job_current = $builder->build_object( |
| 89 |
{ |
| 90 |
class => 'Koha::BackgroundJobs', |
| 91 |
value => { |
| 92 |
status => 'new', |
| 93 |
progress => 100, |
| 94 |
size => 100, |
| 95 |
borrowernumber => $patron->borrowernumber, |
| 96 |
type => 'batch_item_record_modification', |
| 97 |
queue => 'default', |
| 98 |
#data => '{"record_ids":["1"],"regex_mod":null,"exclude_from_local_holds_priority":null,"new_values":{"itemnotes":"xxx"}}' , |
| 99 |
data => '{"regex_mod":null,"report":{"total_records":1,"modified_fields":1,"modified_itemnumbers":[1]},"new_values":{"itemnotes":"xxx"},"record_ids":["1"],"exclude_from_local_holds_priority":null}', |
| 100 |
} |
| 101 |
} |
| 102 |
); |
| 103 |
|
| 88 |
{ |
104 |
{ |
| 89 |
$t->get_ok("//$superlibrarian_userid:$password@/api/v1/jobs") |
105 |
$t->get_ok("//$superlibrarian_userid:$password@/api/v1/jobs") |
| 90 |
->status_is(200)->json_is( [ $job->to_api ] ); |
106 |
->status_is(200)->json_is( [ $job->to_api, $job_current->to_api ] ); |
|
|
107 |
|
| 108 |
$t->get_ok("//$superlibrarian_userid:$password@/api/v1/jobs?only_current=1") |
| 109 |
->status_is(200)->json_is( [ $job_current->to_api ] ); |
| 91 |
|
110 |
|
| 92 |
$t->get_ok("//$librarian_userid:$password@/api/v1/jobs") |
111 |
$t->get_ok("//$librarian_userid:$password@/api/v1/jobs") |
| 93 |
->status_is(200)->json_is( [] ); |
112 |
->status_is(200)->json_is( [] ); |
| 94 |
- |
|
|