Fix #5146: Adding an existing favorite to favorite groups leads to an error.

Show "Favgroup already contains post XXX" error when trying to add a
post to a favgroup that already contains that post.
This commit is contained in:
evazion
2022-05-02 14:15:53 -05:00
parent 5e923e266b
commit 93352b318e
6 changed files with 26 additions and 17 deletions

View File

@@ -534,8 +534,7 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
@pool = create(:pool)
@pool.add!(@post)
@favgroup = create(:favorite_group)
@favgroup.add!(@post)
@favgroup = create(:favorite_group, post_ids: [@post.id])
@comment = create(:comment, post: @post, creator: @admin)
create(:comment_vote, comment: @comment, user: @user)