|
Lines 17-23
Link Here
|
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
| 20 |
use Test::More tests => 1; |
20 |
use Test::More tests => 2; |
| 21 |
use Test::Mojo; |
21 |
use Test::Mojo; |
| 22 |
|
22 |
|
| 23 |
use t::lib::TestBuilder; |
23 |
use t::lib::TestBuilder; |
|
Lines 70-72
subtest 'list_managers() tests' => sub {
Link Here
|
| 70 |
|
70 |
|
| 71 |
$schema->storage->txn_rollback; |
71 |
$schema->storage->txn_rollback; |
| 72 |
}; |
72 |
}; |
| 73 |
- |
73 |
|
|
|
74 |
subtest 'list() tests' => sub { |
| 75 |
|
| 76 |
plan tests => 6; |
| 77 |
|
| 78 |
$schema->storage->txn_begin; |
| 79 |
|
| 80 |
$schema->resultset('Aqbasket')->search->delete; |
| 81 |
|
| 82 |
my $superlibrarian = |
| 83 |
$builder->build_object( { class => 'Koha::Patrons', value => { flags => 1 } } ); |
| 84 |
my $password = 'thePassword123'; |
| 85 |
$superlibrarian->set_password( { password => $password, skip_validation => 1 } ); |
| 86 |
my $userid = $superlibrarian->userid; |
| 87 |
$superlibrarian->discard_changes; |
| 88 |
|
| 89 |
$t->get_ok("//$userid:$password@/api/v1/acquisitions/baskets")->status_is(200)->json_is( |
| 90 |
[] |
| 91 |
); |
| 92 |
|
| 93 |
my $vendor = $builder->build_object( |
| 94 |
{ |
| 95 |
class => 'Koha::Acquisition::Booksellers', |
| 96 |
} |
| 97 |
); |
| 98 |
my $basket = $builder->build_object( |
| 99 |
{ |
| 100 |
class => 'Koha::Acquisition::Baskets', |
| 101 |
value => { closedate => undef, authorisedby => undef, booksellerid => $vendor->id, branch => undef } |
| 102 |
} |
| 103 |
); |
| 104 |
|
| 105 |
$t->get_ok("//$userid:$password@/api/v1/acquisitions/baskets")->status_is(200)->json_is( [$basket->to_api ]); |
| 106 |
|
| 107 |
$schema->storage->txn_rollback; |
| 108 |
|
| 109 |
} |