From d9f04373c740aac77b2c04a9458010a4a76371fb Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 28 May 2025 16:18:58 -0300 Subject: [PATCH] Bug 40023: Unit tests Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/api/v1/password_validation.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/api/v1/password_validation.t b/t/db_dependent/api/v1/password_validation.t index 74b025d96db..d1fc214c7a9 100755 --- a/t/db_dependent/api/v1/password_validation.t +++ b/t/db_dependent/api/v1/password_validation.t @@ -116,7 +116,7 @@ subtest 'password validation - unauthenticated user' => sub { subtest 'Password validation - authorized requests tests' => sub { - plan tests => 24; + plan tests => 27; $schema->storage->txn_begin; @@ -184,6 +184,11 @@ subtest 'Password validation - authorized requests tests' => sub { ->json_is( { cardnumber => $librarian->cardnumber, patron_id => $librarian->id, userid => $librarian->userid } ); + $t->post_ok( + "//$userid:$password@/api/v1/auth/password/validation" => { 'x-koha-embed' => 'patron' } => json => $json ) + ->status_is( 201, 'Validating using the `userid` attribute works, x-koha-embed too' ) + ->json_is( '/patron/patron_id' => $librarian->id ); + $json = { password => $password, userid => $librarian->cardnumber, -- 2.49.0