added delete all posts button

wired up the ability to enable all themes
This commit is contained in:
Sam Saffron
2013-02-07 18:11:56 +11:00
parent 8f4417f962
commit 85973ce6b0
13 changed files with 93 additions and 17 deletions

View File

@ -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