Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TeDomum
Prismo
Commits
7e8ef56c
Commit
7e8ef56c
authored
Oct 15, 2018
by
mbajur
Browse files
Comment auto-vote fix
parent
b633e109
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/interactions/comments/create.rb
View file @
7e8ef56c
...
...
@@ -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
...
...
spec/interactions/comments/create_spec.rb
View file @
7e8ef56c
...
...
@@ -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
)
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment