Commit 7e8ef56c authored by mbajur's avatar mbajur
Browse files

Comment auto-vote fix

parent b633e109
......@@ -43,12 +43,10 @@ class Comments::Create < ActiveInteraction::Base
end
def after_comment_create(comment)
Comments::Vote.run(comment: comment, account: account) if auto_vote
comment.cache_depth
comment.cache_body
Comments::Vote.run! comment: comment, account: account
Comments::Vote.run!(comment: comment, account: account) if auto_vote
Comments::BroadcastCreation.run! comment: comment
Notifications::SendForComment.run! comment: comment
ActivityPub::DistributionJob.call(comment) if local
......
......@@ -74,6 +74,12 @@ describe Comments::Create do
end
end
context 'when auto_vote is false' do
let(:inputs) { valid_inputs.merge(auto_vote: false) }
it { expect { subject }.to_not change(Vote, :count) }
end
context 'when comment is local' do
let(:inputs) { valid_inputs.merge(local: true) }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment