FIX: Show the envelope icon when the flagged post is a PM. Flagged PM must be exclusively reviewed by admins (#9232)

This commit is contained in:
Roman Rizzi
2020-03-19 15:12:42 -03:00
committed by GitHub
parent 226d81fcc5
commit 080960a15e
3 changed files with 13 additions and 2 deletions

View File

@@ -78,6 +78,17 @@ RSpec.describe Reviewable, type: :model do
expect(r1.pending?).to eq(true)
expect(r0.pending?).to eq(false)
end
it 'sets the reviewable_by_moderator attribute to false when the topic is a PM' do
pm_topic = Fabricate(:private_message_topic)
post = Fabricate(:post, topic: pm_topic)
reviewable = ReviewableFlaggedPost.needs_review!(
target: post, topic: pm_topic,
created_by: Discourse.system_user, reviewable_by_moderator: true
)
expect(reviewable.reviewable_by_moderator).to eq(false)
end
end
context ".list_for" do