feature #7: add find_comment_by_id query

This commit is contained in:
2019-08-27 12:53:34 +02:00
parent ff76bd55ef
commit b2230f2fed
2 changed files with 5 additions and 1 deletions

View File

@@ -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,