mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: before nuking a user, do a real count of posts instead of relying on user_stat record
This commit is contained in:
parent
5b3a758ba9
commit
d273374f1a
3 changed files with 14 additions and 3 deletions
|
@ -311,8 +311,9 @@ describe Admin::UsersController do
|
|||
context "user has post" do
|
||||
|
||||
before do
|
||||
@user = build(:user)
|
||||
@user.stubs(:post_count).returns(1)
|
||||
@user = Fabricate(:user)
|
||||
topic = create_topic(user: @user)
|
||||
post = create_post(topic: topic, user: @user)
|
||||
@user.stubs(:first_post_created_at).returns(Time.zone.now)
|
||||
User.expects(:find_by).with(id: @delete_me.id).returns(@user)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue