Lines 34-40
t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 );
Link Here
|
34 |
|
34 |
|
35 |
subtest 'list_patron_attributes() tests' => sub { |
35 |
subtest 'list_patron_attributes() tests' => sub { |
36 |
|
36 |
|
37 |
plan tests => 9; |
37 |
plan tests => 10; |
38 |
|
38 |
|
39 |
$schema->storage->txn_begin; |
39 |
$schema->storage->txn_begin; |
40 |
|
40 |
|
Lines 68-73
subtest 'list_patron_attributes() tests' => sub {
Link Here
|
68 |
->status_is( 404 ) |
68 |
->status_is( 404 ) |
69 |
->json_is( '/error' => 'Patron not found' ); |
69 |
->json_is( '/error' => 'Patron not found' ); |
70 |
|
70 |
|
|
|
71 |
subtest 'nullable value' => sub { |
72 |
# FIXME This is not correct, we should remove the NULLABLE clause at the DBMS level |
73 |
# This test will need to be adjusted on bug 32331 |
74 |
plan tests => 3; |
75 |
|
76 |
my $user = $builder->build_object({class => 'Koha::Patrons'}); |
77 |
|
78 |
$builder->build_object( |
79 |
{ |
80 |
class => 'Koha::Patron::Attributes', |
81 |
value => { borrowernumber => $user->id, attribute => undef } |
82 |
} |
83 |
); |
84 |
|
85 |
$t->get_ok( "//$userid:$password@/api/v1/patrons/" |
86 |
. $user->id |
87 |
. '/extended_attributes' )->status_is( 200, 'SWAGGER3.2.2' ) |
88 |
->json_is( |
89 |
'' => $user->extended_attributes->to_api, |
90 |
'Extended attributes retrieved correctly' |
91 |
); |
92 |
|
93 |
}; |
94 |
|
71 |
$schema->storage->txn_rollback; |
95 |
$schema->storage->txn_rollback; |
72 |
}; |
96 |
}; |
73 |
|
97 |
|
74 |
- |
|
|