FIX: PostActionCreator was not checking the guardian properly

It also exposed a bug in the EmailReceiver spec, where a test had a user
liking their own post and was not failing.
This commit is contained in:
Robin Ward
2019-01-31 14:47:41 -05:00
parent ec7f418a22
commit 720e896e17
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ class PostActionCreator
end
def perform(action)
guardian.ensure_post_can_act!(@post, action, opts: {
guardian.ensure_post_can_act!(@post, PostActionType.types[action], opts: {
taken_actions: PostAction.counts_for([@post].compact, @user)[@post&.id]
})