mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
more fixes for post ownership change and user deletion
This commit is contained in:
@@ -43,8 +43,8 @@ describe PostOwnerChanger do
|
||||
topic.user_id = p1user.id
|
||||
topic.save!
|
||||
|
||||
p1user.user_stat.update_attributes(topic_count: 1, post_count: 1)
|
||||
p2user.user_stat.update_attributes(topic_count: 0, post_count: 1)
|
||||
p1user.user_stat.update_attributes(topic_count: 1, post_count: 1, first_post_created_at: p1.created_at, topic_reply_count: 0)
|
||||
p2user.user_stat.update_attributes(topic_count: 0, post_count: 1, first_post_created_at: p2.created_at, topic_reply_count: 1)
|
||||
|
||||
UserAction.create!( action_type: UserAction::NEW_TOPIC, user_id: p1user.id, acting_user_id: p1user.id,
|
||||
target_post_id: p1.id, target_topic_id: p1.topic_id, created_at: p1.created_at )
|
||||
@@ -66,6 +66,11 @@ describe PostOwnerChanger do
|
||||
p2user.post_count.should == 0
|
||||
user_a.topic_count.should == 1
|
||||
user_a.post_count.should == 2
|
||||
p1user.user_stat.first_post_created_at.should == nil
|
||||
p2user.user_stat.first_post_created_at.should == nil
|
||||
p1user.user_stat.topic_reply_count.should == 0
|
||||
p2user.user_stat.topic_reply_count.should == 0
|
||||
[p1.created_at, p2.created_at].should include(user_a.user_stat.first_post_created_at)
|
||||
end
|
||||
|
||||
it "updates UserAction records" do
|
||||
|
||||
Reference in New Issue
Block a user