Add Test for Notification routes

Add @JsonSubTypes on Notification
return all creator on request find_follows_article_by_target
Add testNotifications task
This commit is contained in:
2021-04-14 01:41:49 +02:00
parent 50b4cf1816
commit 39c665b7a9
9 changed files with 130 additions and 13 deletions

View File

@@ -29,6 +29,9 @@ begin
assert (select following = true from find_follow(first_article_id, _citizen_id, 'article')), '(v1) find_follow must return the following';
assert (select following = true from find_follow(first_article_updated_id, _citizen_id, 'article')), '(v2) find_follow must return the following';
assert (select f.total = 1 from find_follows_article_by_target(first_article_id) as f), 'find_follows_article_by_target must return 1 follow';
assert (select (f.resource#>>'{0, created_by, id}')::uuid = _citizen_id from find_follows_article_by_target(first_article_id) as f), 'find_follows_article_by_target must return follows with creator';
perform unfollow('article'::regclass, first_article_id, _citizen_id);
assert (select count(*) = 0 from follow), 'follow must be deleted after unfollow, event if article is on other version';