mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 21:59:34 +08:00
FEATURE: disable post editing when the post has active flag
This commit is contained in:
@ -137,11 +137,12 @@ describe Post do
|
||||
end
|
||||
|
||||
describe 'flagging helpers' do
|
||||
it 'isFlagged is accurate' do
|
||||
post = Fabricate(:post)
|
||||
user = Fabricate(:coding_horror)
|
||||
PostAction.act(user, post, PostActionType.types[:off_topic])
|
||||
let(:post) { Fabricate(:post) }
|
||||
let(:user) { Fabricate(:coding_horror) }
|
||||
let(:admin) { Fabricate(:admin) }
|
||||
|
||||
it 'isFlagged is accurate' do
|
||||
PostAction.act(user, post, PostActionType.types[:off_topic])
|
||||
post.reload
|
||||
expect(post.is_flagged?).to eq(true)
|
||||
|
||||
@ -149,6 +150,16 @@ describe Post do
|
||||
post.reload
|
||||
expect(post.is_flagged?).to eq(false)
|
||||
end
|
||||
|
||||
it 'has_active_flag is accurate' do
|
||||
PostAction.act(user, post, PostActionType.types[:spam])
|
||||
post.reload
|
||||
expect(post.has_active_flag?).to eq(true)
|
||||
|
||||
PostAction.defer_flags!(post, admin)
|
||||
post.reload
|
||||
expect(post.has_active_flag?).to eq(false)
|
||||
end
|
||||
end
|
||||
|
||||
describe "maximum images" do
|
||||
|
Reference in New Issue
Block a user