mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
added delete all posts button
wired up the ability to enable all themes
This commit is contained in:
@ -67,12 +67,8 @@ describe User do
|
||||
user.reload
|
||||
user.posts_read_count.should == 1
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
context '.enqueue_welcome_message' do
|
||||
@ -174,6 +170,29 @@ describe User do
|
||||
|
||||
end
|
||||
|
||||
describe 'delete posts' do
|
||||
before do
|
||||
@post1 = Fabricate(:post)
|
||||
@user = @post1.user
|
||||
@post2 = Fabricate(:post, topic: @post1.topic, user: @user)
|
||||
@post3 = Fabricate(:post, user: @user)
|
||||
@posts = [@post1, @post2, @post3]
|
||||
@guardian = Guardian.new(Fabricate(:admin))
|
||||
end
|
||||
|
||||
it 'allows moderator to delete all posts' do
|
||||
@user.delete_all_posts!(@guardian)
|
||||
@posts.each do |p|
|
||||
p.reload
|
||||
if p
|
||||
p.topic.should be_nil
|
||||
else
|
||||
p.should be_nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
describe 'new' do
|
||||
|
||||
|
Reference in New Issue
Block a user