refactoring: replace procedure find_user_by_* to function
This commit is contained in:
@@ -11,11 +11,11 @@ begin
|
||||
assert created_user->>'password' is not null, 'password must be generated';
|
||||
|
||||
-- get user by there id and check the username is correct
|
||||
call find_user_by_id((created_user->>'id')::uuid, selected_user);
|
||||
assert selected_user->>'username' = 'george', 'username must be george';
|
||||
select find_user_by_id((created_user->>'id')::uuid) into selected_user;
|
||||
assert selected_user->>'username' = 'george', format('username must be george, %s instead', selected_user);
|
||||
|
||||
-- get user by username and check the username is correct
|
||||
call find_user_by_username(created_user->>'username', selected_user);
|
||||
select find_user_by_username(created_user->>'username') into selected_user;
|
||||
assert selected_user->>'username' = 'george', 'username must be george';
|
||||
|
||||
-- check if user exist with username and password and verify the reterned user
|
||||
|
||||
Reference in New Issue
Block a user