feature #7: add find_comment_by_id query
This commit is contained in:
@@ -8,7 +8,7 @@ begin
|
||||
insert into "user" (id, username, password, blocked_at, roles)
|
||||
select
|
||||
uuid_in(md5('user'||rn::text)::cstring),
|
||||
'username' || rn,
|
||||
'username-' || rn,
|
||||
_password,
|
||||
case when rn % 10 = 0 then now() else null end,
|
||||
case when rn % 2 = 0 then '{ROLE_USER}'::text[] else '{ROLE_ADMIN}'::text[] end
|
||||
|
||||
@@ -32,6 +32,7 @@ declare
|
||||
_selected_comments_total int;
|
||||
_find_comments_by_target_result json;
|
||||
_find_comments_by_parent_result json;
|
||||
_find_comments_by_id_result json;
|
||||
begin
|
||||
-- insert user for context
|
||||
select insert_user(created_user) into created_user;
|
||||
@@ -55,6 +56,9 @@ begin
|
||||
) into _comment_id;
|
||||
assert (select count(*) = 1 from "comment"), 'comment must be inserted';
|
||||
|
||||
select find_comment_by_id(_comment_id) into _find_comments_by_id_result;
|
||||
assert (_find_comments_by_id_result->>'content' = 'Ho my god !'), 'content of comment must be "Ho my god !"';
|
||||
|
||||
perform edit_comment(
|
||||
reference => 'article'::regclass,
|
||||
id => _comment_id,
|
||||
|
||||
Reference in New Issue
Block a user