Lines 66-80
subtest 'list() tests' => sub {
Link Here
|
66 |
# No acquisitions\/edifiles, so empty array should be returned |
66 |
# No acquisitions\/edifiles, so empty array should be returned |
67 |
$t->get_ok("//$userid:$password@/api/v1/acquisitions/edifiles")->status_is(200)->json_is( [] ); |
67 |
$t->get_ok("//$userid:$password@/api/v1/acquisitions/edifiles")->status_is(200)->json_is( [] ); |
68 |
|
68 |
|
69 |
my $file = $builder->build_object( { class => 'Koha::Edifact::Files', value => { message_type => 'ORDER' } } ); |
69 |
my $file = $builder->build_object( |
|
|
70 |
{ class => 'Koha::Edifact::Files', value => { message_type => 'ORDER', deleted => 0 } } ); |
70 |
|
71 |
|
71 |
# One file created, should get returned |
72 |
my $deleted_file = $builder->build_object( |
|
|
73 |
{ class => 'Koha::Edifact::Files', value => { message_type => 'ORDER', deleted => 1 } } ); |
74 |
|
75 |
# One file undeleted, should get returned |
72 |
$t->get_ok("//$userid:$password@/api/v1/acquisitions/edifiles")->status_is(200)->json_is( [ $file->to_api ] ); |
76 |
$t->get_ok("//$userid:$password@/api/v1/acquisitions/edifiles")->status_is(200)->json_is( [ $file->to_api ] ); |
73 |
|
77 |
|
74 |
my $another_file_ORDER = |
78 |
my $another_file_ORDER = |
75 |
$builder->build_object( { class => 'Koha::Edifact::Files', value => { message_type => 'ORDER' } } ); |
79 |
$builder->build_object( |
|
|
80 |
{ class => 'Koha::Edifact::Files', value => { message_type => 'ORDER', deleted => 0 } } ); |
76 |
my $another_file_QUOTE = |
81 |
my $another_file_QUOTE = |
77 |
$builder->build_object( { class => 'Koha::Edifact::Files', value => { message_type => 'QUOTE' } } ); |
82 |
$builder->build_object( |
|
|
83 |
{ class => 'Koha::Edifact::Files', value => { message_type => 'QUOTE', deleted => 0 } } ); |
78 |
|
84 |
|
79 |
# Two files created, they should both be returned |
85 |
# Two files created, they should both be returned |
80 |
$t->get_ok("//$userid:$password@/api/v1/acquisitions/edifiles")->status_is(200)->json_is( |
86 |
$t->get_ok("//$userid:$password@/api/v1/acquisitions/edifiles")->status_is(200)->json_is( |
81 |
- |
|
|