mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
A staff member can hide another staff's member's post by flagging
This commit is contained in:
@ -382,7 +382,7 @@ describe PostAction do
|
||||
expect(post.spam_count).to eq(0)
|
||||
end
|
||||
|
||||
it "will not auto hide staff posts" do
|
||||
it "will not allow regular users to auto hide staff posts" do
|
||||
mod = Fabricate(:moderator)
|
||||
post = Fabricate(:post, user: mod)
|
||||
|
||||
@ -398,6 +398,22 @@ describe PostAction do
|
||||
expect(post.hidden_at).to be_blank
|
||||
end
|
||||
|
||||
it "allows staff users to auto hide staff posts" do
|
||||
mod = Fabricate(:moderator)
|
||||
post = Fabricate(:post, user: mod)
|
||||
|
||||
SiteSetting.flags_required_to_hide_post = 2
|
||||
Discourse.stubs(:site_contact_user).returns(admin)
|
||||
|
||||
PostAction.act(eviltrout, post, PostActionType.types[:spam])
|
||||
PostAction.act(Fabricate(:admin), post, PostActionType.types[:spam])
|
||||
|
||||
post.reload
|
||||
|
||||
expect(post.hidden).to eq(true)
|
||||
expect(post.hidden_at).to be_present
|
||||
end
|
||||
|
||||
it 'should follow the rules for automatic hiding workflow' do
|
||||
post = create_post
|
||||
walterwhite = Fabricate(:walter_white)
|
||||
|
Reference in New Issue
Block a user