mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: log topic/post deletions from staff members
This commit is contained in:
@@ -170,6 +170,12 @@ describe PostDestroyer do
|
||||
author.reload
|
||||
}.to change { author.post_count }.by(-1)
|
||||
end
|
||||
|
||||
it "creates a new user history entry" do
|
||||
expect {
|
||||
PostDestroyer.new(moderator, post).destroy
|
||||
}.to change { UserHistory.count}.by(1)
|
||||
end
|
||||
end
|
||||
|
||||
context "as an admin" do
|
||||
@@ -258,6 +264,12 @@ describe PostDestroyer do
|
||||
post.deleted_at.should be_present
|
||||
post.deleted_by.should == admin
|
||||
end
|
||||
|
||||
it "creates a new user history entry" do
|
||||
expect {
|
||||
PostDestroyer.new(admin, post).destroy
|
||||
}.to change { UserHistory.count}.by(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user