FEATURE: show post approvals in Moderation History (#6643)

This commit is contained in:
Kyle Zhao 2018-11-21 21:22:23 -05:00 committed by Guo Xiang Tan
parent ee6c0170ce
commit 8e32aa1483
3 changed files with 14 additions and 1 deletions

View File

@ -10,7 +10,8 @@ class Admin::ModerationHistoryController < Admin::AdminController
:suspend_user,
:silence_user,
:delete_post,
:delete_topic
:delete_topic,
:post_approved,
).values
)

View File

@ -3475,6 +3475,7 @@ en:
silence_user: "User Silenced"
delete_post: "Post Deleted"
delete_topic: "Topic Deleted"
post_approved: "Post Approved"
logs:
title: "Logs"

View File

@ -35,6 +35,17 @@ RSpec.describe Admin::BackupsController do
expect(::JSON.parse(response.body)['moderation_history']).to be_present
end
it 'includes post approval record' do
queued_post = Fabricate(:queued_post)
post = queued_post.approve!(Discourse.system_user)
get "/admin/moderation_history.json?filter=post&post_id=#{post.id}"
expect(response.status).to eq(200)
moderation_history = JSON.parse(response.body)['moderation_history'].first
expect(moderation_history['action_name']).to eq('post_approved')
end
end
describe "for a topic" do