comments: add test for undeleting locked comments.

ref: #4258, #2728.
This commit is contained in:
evazion
2020-01-16 12:16:38 -06:00
parent 09833e9b61
commit eecd9a183d

View File

@@ -220,6 +220,18 @@ class CommentsControllerTest < ActionDispatch::IntegrationTest
assert_equal(false, @comment.reload.is_deleted)
assert_redirected_to(@comment)
end
should "not allow undeleting comments deleted by a moderator" do
@comment = create(:comment, post: @post)
delete_auth comment_path(@comment.id), @mod
assert_redirected_to @comment
assert(@comment.reload.is_deleted?)
post_auth undelete_comment_path(@comment.id), @user
assert_response 403
assert(@comment.reload.is_deleted?)
end
end
end
end