FIX: before nuking a user, do a real count of posts instead of relying on user_stat record

This commit is contained in:
Neil Lalonde
2014-08-18 12:07:21 -04:00
parent 5b3a758ba9
commit d273374f1a
3 changed files with 14 additions and 3 deletions

View File

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