FIX: when changing owner of last post user list on topic incorrect

This commit is contained in:
Sam Saffron
2016-03-16 23:49:27 +11:00
parent 49502f4601
commit b300d60086
2 changed files with 7 additions and 1 deletions

View File

@@ -21,8 +21,9 @@ describe PostOwnerChanger do
it "changes the user" do
old_user = p1.user
described_class.new(post_ids: [p1.id], topic_id: topic.id, new_owner: user_a, acting_user: editor).change_owner!
PostOwnerChanger.new(post_ids: [p1.id], topic_id: topic.id, new_owner: user_a, acting_user: editor).change_owner!
p1.reload
expect(p1.topic.last_post_user_id).to eq(user_a.id)
expect(old_user).not_to eq(p1.user)
expect(p1.user).to eq(user_a)
end