Fix #4946: Don't Add Comments to Posts When Doing Post Replacements.
This commit is contained in:
@@ -224,12 +224,6 @@ class UploadServiceTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
context "#process!" do
|
||||
should "create a comment" do
|
||||
assert_difference(-> { @post.reload.comments.count }) do
|
||||
as(@user) { @post.reload.replace!(replacement_url: "", replacement_file: @new_file) }
|
||||
end
|
||||
end
|
||||
|
||||
should "not create a new post" do
|
||||
assert_difference(-> { Post.count }, 0) do
|
||||
as(@user) { @post.reload.replace!(replacement_url: "", replacement_file: @new_file) }
|
||||
@@ -400,12 +394,6 @@ class UploadServiceTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
context "#process!" do
|
||||
should "create a comment" do
|
||||
assert_difference(-> { @post.reload.comments.count }) do
|
||||
as(@user) { @post.reload.replace!(replacement_url: @new_url) }
|
||||
end
|
||||
end
|
||||
|
||||
should "not create a new post" do
|
||||
assert_difference(-> { Post.count }, 0) do
|
||||
as(@user) { @post.reload.replace!(replacement_url: @new_url) }
|
||||
@@ -431,14 +419,6 @@ class UploadServiceTest < ActiveSupport::TestCase
|
||||
@post.reload
|
||||
end
|
||||
end
|
||||
|
||||
should "leave a system comment" do
|
||||
as(@user) { @post.reload.replace!(replacement_url: @new_url) }
|
||||
comment = @post.comments.last
|
||||
assert_not_nil(comment)
|
||||
assert_equal(User.system.id, comment.creator_id)
|
||||
assert_match(/replaced this post/, comment.body)
|
||||
end
|
||||
end
|
||||
|
||||
context "a post with a pixiv html source" do
|
||||
|
||||
Reference in New Issue
Block a user