mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: If you delete a user, delete their queued posts as well.
This commit is contained in:
@ -105,11 +105,13 @@ describe User do
|
||||
@post3 = Fabricate(:post, user: @user)
|
||||
@posts = [@post1, @post2, @post3]
|
||||
@guardian = Guardian.new(Fabricate(:admin))
|
||||
@queued_post = Fabricate(:queued_post, user: @user)
|
||||
end
|
||||
|
||||
it 'allows moderator to delete all posts' do
|
||||
@user.delete_all_posts!(@guardian)
|
||||
expect(Post.where(id: @posts.map(&:id))).to be_empty
|
||||
expect(QueuedPost.where(user_id: @user.id).count).to eq(0)
|
||||
@posts.each do |p|
|
||||
if p.is_first_post?
|
||||
expect(Topic.find_by(id: p.topic_id)).to be_nil
|
||||
|
Reference in New Issue
Block a user