BURs: add test for users voting on their own BURs (#4527)

This commit is contained in:
evazion
2020-06-23 02:43:12 -05:00
parent da9c145c64
commit 0276792b35

View File

@@ -36,6 +36,13 @@ class ForumPostVotesControllerTest < ActionDispatch::IntegrationTest
assert_response 403
end
end
should "not allow creators to vote on their own BURs" do
assert_difference("ForumPostVote.count", 0) do
post_auth forum_post_votes_path(format: :js), @bulk_update_request.user, params: { forum_post_id: @forum_post.id, forum_post_vote: { score: 1 }}
assert_response 403
end
end
end
context "destroy action" do