FIX: when posts are moved to a message then small action post should not be publicly visible (#7085)

This fix is inspired from what we do in discourse-assigned plugin.
https://github.com/discourse/discourse-assign/blob/master/lib/topic_assigner.rb#L184
https://github.com/discourse/discourse-assign/blob/master/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6#L125-L133
This commit is contained in:
Arpit Jalan
2019-02-28 19:49:26 +05:30
committed by GitHub
parent bb5119b88f
commit c02956e29c
3 changed files with 6 additions and 4 deletions

View File

@@ -619,7 +619,7 @@ describe PostMover do
old_message.reload
move_message = old_message.posts.find_by(post_number: 2)
expect(move_message.post_type).to eq(Post.types[:small_action])
expect(move_message.post_type).to eq(Post.types[:whisper])
expect(move_message.raw).to include("2 posts were split")
end
end
@@ -662,7 +662,7 @@ describe PostMover do
it "uses the correct small action post" do
moved_to = personal_message.move_posts(admin, [p2.id], destination_topic_id: another_personal_message.id, archetype: "private_message")
post = Post.find_by(topic_id: personal_message.id, post_type: Post.types[:small_action])
post = Post.find_by(topic_id: personal_message.id, post_type: Post.types[:whisper])
expected_text = I18n.t(
"move_posts.existing_message_moderator_post",