Lines 52-59
subtest 'basic tests' => sub {
Link Here
|
52 |
|
52 |
|
53 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
53 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
54 |
|
54 |
|
55 |
t::lib::Mocks::mock_preference( 'dateformat','us' ); |
|
|
56 |
|
57 |
my $new_password = 'abc'; |
55 |
my $new_password = 'abc'; |
58 |
|
56 |
|
59 |
$t->put_ok( "//$userid:$password@/api/v1/patrons/" |
57 |
$t->put_ok( "//$userid:$password@/api/v1/patrons/" |
Lines 66-81
subtest 'basic tests' => sub {
Link Here
|
66 |
. $patron->id |
64 |
. $patron->id |
67 |
. "/password/expiration_date" => json => |
65 |
. "/password/expiration_date" => json => |
68 |
{ expiration_date => '01/13/2021' } ) |
66 |
{ expiration_date => '01/13/2021' } ) |
69 |
->status_is(200)->json_is(''); |
67 |
->status_is(400)->json_is('/errors/0/message' => 'Does not match date format.'); |
70 |
|
68 |
|
71 |
$t->put_ok( "//$userid:$password@/api/v1/patrons/" |
69 |
$t->put_ok( "//$userid:$password@/api/v1/patrons/" |
72 |
. $patron->id |
70 |
. $patron->id |
73 |
. "/password/expiration_date" => json => |
71 |
. "/password/expiration_date" => json => |
74 |
{ expiration_date => '13/01/2021' } ) |
72 |
{ expiration_date => '13/01/2021' } ) |
75 |
->status_is(500)->json_is({ |
73 |
->status_is(400)->json_is('/errors/0/message' => 'Does not match date format.'); |
76 |
error => 'Something went wrong, check Koha logs for details.', |
|
|
77 |
error_code => "internal_server_error" |
78 |
}); |
79 |
|
74 |
|
80 |
$privileged_patron->flags(0)->store(); |
75 |
$privileged_patron->flags(0)->store(); |
81 |
|
76 |
|
Lines 90-96
subtest 'basic tests' => sub {
Link Here
|
90 |
} |
85 |
} |
91 |
}); |
86 |
}); |
92 |
|
87 |
|
93 |
|
|
|
94 |
|
95 |
$schema->storage->txn_rollback; |
88 |
$schema->storage->txn_rollback; |
96 |
}; |
89 |
}; |
97 |
- |
|
|