mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-20 20:11:19 -04:00
FIX: Recovering a deleted post was not updating a topic's statistics
This commit is contained in:
parent
1be08dbcb5
commit
d98f288aa4
2 changed files with 4 additions and 1 deletions
|
@ -121,6 +121,8 @@ class PostsController < ApplicationController
|
|||
post = find_post_from_params
|
||||
guardian.ensure_can_recover_post!(post)
|
||||
post.recover!
|
||||
post.topic.update_statistics
|
||||
|
||||
render nothing: true
|
||||
end
|
||||
|
||||
|
|
|
@ -123,8 +123,9 @@ describe PostsController do
|
|||
response.should be_forbidden
|
||||
end
|
||||
|
||||
it "calls recover" do
|
||||
it "calls recover and updates the topic's statistics" do
|
||||
Post.any_instance.expects(:recover!)
|
||||
Topic.any_instance.expects(:update_statistics)
|
||||
xhr :put, :recover, post_id: post.id
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue